Symfony Docker PHPunit Fatal error: require(): Failed opening required - docker

I have a problem when i try to execute php bin/phpunit from docker.
Warning: require(/user/project/bin/.phpunit/phpunit-7.5-0/vendor/composer/../symfony/phpunit-bridge/bootstrap.php): failed to open stream: No such file or directory in /user/project/bin/.phpunit/phpunit-7.5-0/vendor/composer/autoload_real.php on line 69
If i execute php bin/phpunit from terminal in my computer it works.
If i delete phpunit folder from /bin directory in symfony project and i try to execute php bin/phpunit from docker it works (after phpunit re-installation in /bin folder) on docker machine but not on my pc. Perhaps the problem is in symlink but i'm not able to solve this issue.

Please be sure that when you build your container you execute the composer install command.
If the problem still persist please share a snap of your Dockerfile

Related

file_put_contents(/root/.composer/cache/repo/https---flex.symfony.com/): failed to open stream: Is a directory error

I build my symfony 4 application with composer install inside docker container.
Composer version 1.10.19
But i got this error.
[ErrorException]
file_put_contents(/root/.composer/cache/repo/https---flex.symfony.com/): failed to open stream: Is a directory
If i run composer install 1 more time without any interruption build is succeeded.
If i delete vendor and var/cache directory on project directory error accoured again.
I tried this methods:
trigger 'composer clearcache' command no success
Delete ~/.composer directory no success
chmod -R 777 ~/.composer no success
Some build of the same project inside different container is succeeded. My container starts with this volumes:
project directory
~/.ssh directory
I search across net but got no solution. PLease help.
This was a bug on Flex version <1.13.4
In latest version (as I write 1.13.4) the issue is solved.
The problem was:
Writing to the cache with an empty key will fail with "failed to open
stream: Is a directory", so do not try to do that.
We noticed this when cloudflare - or the backend service - responded with a "last-modified" header for our CI servers (AWS) but not for our local system. This triggered the condition to become true and it tries to write a cache file without a filename.
That problem was solved with commit d81196c3f3b5
Edit: as posted by #Tmb a workaround is to use: composer install --no-cache ...

Composer Docker image won't run at all

I'm attempting to learn how to create a Laravel Docker image by following a tutorial on DigitalOcean using WSL. Following the instructions on the Docker Hub page, however, yields an error:
❯ docker run --rm --interactive --tty -v $(pwd):/app composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 94 installs, 0 updates, 0 removals
- Installing voku/portable-ascii (1.4.10): Failed to download voku/portable-ascii from dist: Could not delete /app/vendor/voku/portable-ascii/src/voku/helper:
Now trying to download from source
- Installing voku/portable-ascii (1.4.10):
[RuntimeException]
Could not delete /app/vendor/voku/portable-ascii/src/voku/helper:
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...
How can I diagnose what I'm doing wrong?
It turns out that the underlying problem had nothing to do with Docker at all. In fact, Composer was trying to tell me what the problem was all along, but I dismissed it as just a symptom of a deeper issue:
[RuntimeException]
Could not delete /app/vendor/voku/portable-ascii/src/voku/helper:
This message was the crux of it all. I noticed that the directory mentioned, [...]/helper, was empty, so I tried to remove it by hand with rmdir. Instead, I got a No such file or directory error message. I attempted many other was to kill this directory, the entire project directory with rm -rf ~/laravel-app from the home folder, etc. Nothing worked.
Some digging around on the internet suggested that it could be an NTFS corruption if I was running into this issue on Windows. Since I am, indeed, attempting this on WSL (Windows Subsystem for Linux), I gave their suggested fix a try: running chkdsk /F in CMD/PowerShell. A reboot was necessary to complete this task, but after getting everything back up and trying those first few tutorial steps again, I was able to get composer to install the Laravel dependencies without a hitch.
Bottom line: If you run into this sort of issue on WSL, please try running chkdsk /F and reboot. You might just have a similar file system corruption.
We have two possibilities for this error:
1 - You did not execute the command inside the directory :
cd ~/laravel-app
2 - I'm sure there is an internal proxy that is blocking the download of packages.

CircleCI CLI Error on Ubuntu WSL: open .circleci/config.yml: no such file or directory

I'm trying to get the CircleCI CLI tool ( https://circleci.com/docs/2.0/local-jobs/ ) working on Ubuntu WSL on Windows 10. It appeared to install successfully -- and the file permissions appear to be correct. I have Docker for Windows installed and running, and the Linux Docker client works without issue.
But now it always errors when trying to validate a CircleCI config file.
I have tried:
circleci config validate -c .circleci/config.yml
and
circleci config validate
from the root of my repo.
But each time, it gives the error:
Error: open .circleci/config.yml: no such file or directory
Has anyone been able to get this work?
sudo worked for me to overcome this. However, I stuck with the next error.

cp: cannot stat on ./startFabric.sh in Docker for Hyperledger Fabric-Writing Yout First Application

I am currently trying to learn Hyperledger Fabric. I have followed all the instructions till here. I have gotten all the necessary binaries and downloaded all the required samples. When I go into the Fabcar folder and use the "ls" command, I can see all the files expected according to the document EXCEPT chaincode.
$ ls
creds/ invoke.js package.json query.js startFabric.sh*
When I run "./startFabric.sh" command, I get the following errors:
$ ./startFabric.sh
cp: cannot stat '/c/Users/Vaibhav': No such file or directory
cp: cannot stat 'Shah/fabric-samples/fabcar/creds/*': No such file or directory
I am attaching a screenshot of the entire Docker interface below.
Thank you very much.
Screenshot of error in Docker
Check this example in https://github.com/hyperledger/fabric/tree/release/examples/e2e_cli
This is the end-to-end test of the fabric using the command line interface. It helps you understand installation, setting up channels and executing if I recall chaincode_example02. Obviously, this runs on Ubuntu 14.04.
If you are a Windows user, you may want to spin up an Ubuntu 14.04 VM and try out, after installing all the pre-requisites.

Docker hub automated build fails but locally does not

I have setup an automated build on Docker hub here (the sources are here).
The build goes well locally. I have also tried to rebuild it with --no-cache option:
docker build --no-cache .
And the process completes successfully
Successfully built 68b34a5f493a
However, the automated build fails on Docker hub with this error log:
...
Cloning into 'nerdtree'...
[91mVim: Warning: Output is not to a terminal
[0m
[91mVim: Warning: Input is not from a terminal
[0m
[m[m[0m[H[2J[24;1HError detected while processing command line:
E492: Not an editor command: PluginInstall
E492: Not an editor command: GoInstallBinaries
[91mmv: cannot stat `/go/bin/*': No such file or directory
[0m
This build apparently fails on the following vim command:
vim +PluginInstall +GoInstallBinaries +qall
Note that the warnings Output is not to a terminal and Input is not to a terminal appears also in the local build.
I cannot understand how this can happen. I am using a standard Ubuntu 14.04 system.
I finally figured it out. The issue was related to this one.
I am using Docker 1.0 in my host machine, however a later version is in production in Docker Hub. Without the explicit ENV HOME=... line in the Dockerfile, version 1.0 uses / as home directory, while /root is used by the later version. The result is that vim was not able to find its .vimrc file, since it was copied in / instead of /root. The solution I used is to explicitly define ENV HOME=/root in my Dockerfile, so there are no differences between the two versions.

Resources