I want to compile my source project with a docker container like this, at first it worked but now it's getting an error
docker: Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "go build -o main gitlab.org/repo/user-management/main": stat go build -o main gitlab.org/repo/user-management/main: no such file or directory: unknown.
ERRO[0022] error waiting for container: context canceled
I use jenkins to use this command
stage('Compile Source') {
steps {
sh 'docker run -v $(pwd)/:/app -w /app --name "${containerName}" golang:1.17 go build -o main gitlab.org/repo/user-management/main'
}
}
Has anyone ever compile the source code via docker container?
thank you
I am running a docker-compose test; part of my stack that will perform the actual tests is the following service
tester:
image: tutum/curl:latest
volumes:
- ./ci/wait-for-it.sh:/usr/local/bin/wait-for-it.sh
- ./webhooks:/app/webhooks
depends_on:
- sut
command: ["wait-for-it.sh", "sut:8080", "-t", "240", "--", "sh", "pytest /app/webhooks"]
The command fails as follows:
ERROR: for 0114c9206690_alerta-_tester_1 Cannot start service tester: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"wait-for-it.sh\": executable file not found in $PATH": unknown
ERROR: for tester Cannot start service tester: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"wait-for-it.sh\": executable file not found in $PATH": unknown
The file being mounted does exist:
▶ ls docker-compose.test.yaml
docker-compose.test.yaml
Workspace/systems-utils/ alerta_dev_infra ✗ 1d ⚑ ◒
▶ ls ./ci/wait-for-it.sh
./ci/wait-for-it.sh
What is more, when trying to bind mount a non-existent file, instead of getting a mount-related error, i get the same error as above
tester:
image: tutum/curl:latest
volumes:
- ./ci/foofile.sh:/usr/local/bin/wait-for-it.sh
- ./webhooks:/app/webhooks
depends_on:
- sut
command: ["wait-for-it.sh", "sut:8080", "-t", "240", "--", "sh", "pytest /app/webhooks"]
$ docker-compose -f docker-compose.test.yaml up -d
ERROR: for tester Cannot start service tester: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"wait-for-it.sh\": executable file not found in $PATH": unknown
ERROR: Encountered errors while bringing up the project.
What am I missing?
edit: Regarding the PATH issue mentioned, here it is:
▶ docker run -it tutum/curl:latest printenv
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=1f3090676fa0
TERM=xterm
HOME=/
What is more, the tester service configuration is the exact same as in this project which runs perfectly.
As for the permissions issue:
Workspace/systems-utils/alerta-workable alerta_dev_infra ✗ 1d ⚑ ◒ ⍉
▶ ls -al ./ci/wait-for-it.sh
-rwxr-xr-x 1 pkaramol staff 5.1K Sep 6 22:02 ./ci/wait-for-it.sh
The error message is pretty self-explanatory - wait-for-it.sh is not on $PATH.
You need either add /usr/local/bin to $PATH or change command to
command: ["/usr/local/bin/wait-for-it.sh", "sut:8080", "-t", "240", "--", "sh", "pytest /app/webhooks"]
See also accepted answer to this question for why /usr/local/bin might not be in path.
Looks like it could not find "executable file in $PATH"
So let's try to set executable permissions on ./ci/wait-for-it.sh file:
$ chmod +x ./ci/wait-for-it.sh
Error:
Unexpected environment preparation error: failed to create runner binary: error during connect: Put http://%2Fvar%2Frun%2Fdocker.sock/v1.39/containers/e06b3801bd1b159c9227eebf7796d5007433dc58c4fc1c355758f5a9783b8e8f/archive?noOverwriteDirNonDir=true&path=%2Fbin: unexpected EOF
Step failed
Task failed
Just follow the steps, I hope issue will be solved. In my case it's working.
sudo service docker stop
sudo rm -rf /var/lib/docker
sudo service docker start
I just cloned a git project to my CentOS 7 VPS. The project contains docker-compose.yml file and I am trying to run docker-compose up.
The command is exiting with this single error message
ERROR: Error processing tar file(exit status 1): permission denied
I have run the same project successfully on my local machine. I am using docker-compose version 1.15.0 and Docker version 17.06.0-ce.
Can't figure out why this is happening. Could anybody please help?
I am trying to execute shell script in volume inside docker container on windows 7 but seeing following errors:
ln: failed to create symbolic link '/lib/tcl8.5': Protocol error
ln: failed to create hard link 'libpython2.7.so' => 'libpython2.7.so.1.0': Operation not permitted
This is the command in shell script which is giving error:
root#57856515e02b:/artifacts/test/install/lib# ln -s /usr/share/tcltk/tcl8.5 /artifacts/test/install/lib/
ln: failed to create symbolic link '/artifacts/test/install/lib/tcl8.5': Protocol error
I dint see these issues when I run this shell script inside docker container on linux.
$ docker --version
Docker version 17.03.1-ce, build c6d412e
Can someone let me know how can I resolve this issue?