I've tried for a long time to work out what my mistake is in the command I am running but just fail to see the problem.
Here is the docker command that runs on the gitlab runner
docker build --file docker/myapp.Dockerfile --tag apphouse/myapp --tag apphouse/myapp:8ea7b80 --build-arg HTTP_PROXY=http://192.168.121.130:3128 --build-arg HTTPS_PROXY=http://192.168.121.130:3128 --build-arg http_proxy=http://192.168.121.130:3128 --build-arg https_proxy=http://192.168.121.130:3128 --build-arg NO_PROXY=10.61.61.5:80,dind:2375,dind:2376,docker:2375,docker:2376,172.20.38.37,172.20.36.45,172.20.36.29,docker.inf.ryui.lk,nexus.inf.ryui.lk,10.61.61.20,10.61.61.3,gitlab.internal1.lk --build-arg no_proxy=10.61.61.5:80,dind:2375,dind:2376,docker:2375,docker:2376,172.20.38.37,172.20.36.45,172.20.36.29,docker.inf.ryui.lk,nexus.inf.ryui.lk,10.61.61.20,10.61.61.3,gitlab.internal1.lk
Error
"docker build" requires exactly 1 argument.
See 'docker build --help'.
Usage: docker build [OPTIONS] PATH | URL | -
Build an image from a Dockerfile
Here's some output to see where the script is running from
Output of 'pwd'
/home/gitlab-runner/builds/wV5dDxY4/0/apphouse/myapp
Output of 'ls -lrth'
total 24K
-rw-rw-r-- 1 gitlab-runner gitlab-runner 820 Mar 4 18:36 README.md
-rw-rw-r-- 1 gitlab-runner gitlab-runner 134 Mar 4 18:36 local-config.yml
drwxrwxr-x 2 gitlab-runner gitlab-runner 47 Mar 4 18:36 lib
-rwxrwxr-x 1 gitlab-runner gitlab-runner 8.1K Mar 5 00:12 myapp
drwxrwxr-x 2 gitlab-runner gitlab-runner 39 Mar 5 12:15 scripts
drwxrwxr-x 3 gitlab-runner gitlab-runner 95 Mar 5 12:15 docker
CodePudding user response:
Try this:
docker build --tag apphouse/myapp \
--tag apphouse/myapp:8ea7b80 \
--build-arg HTTP_PROXY=http://192.168.121.130:3128 \
--build-arg HTTPS_PROXY=http://192.168.121.130:3128 \
--build-arg http_proxy=http://192.168.121.130:3128 \
--build-arg https_proxy=http://192.168.121.130:3128 \
--build-arg NO_PROXY=10.61.61.5:80,dind:2375,dind:2376,docker:2375,docker:2376,172.20.38.37,172.20.36.45,172.20.36.29,docker.inf.ryui.lk,nexus.inf.ryui.lk,10.61.61.20,10.61.61.3,gitlab.internal1.lk \
--build-arg no_proxy=10.61.61.5:80,dind:2375,dind:2376,docker:2375,docker:2376,172.20.38.37,172.20.36.45,172.20.36.29,docker.inf.ryui.lk,nexus.inf.ryui.lk,10.61.61.20,10.61.61.3,gitlab.internal1.lk \
--file docker/myapp.Dockerfile .