-
Notifications
You must be signed in to change notification settings - Fork 589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker: cannot ping detached service in another step #321
Comments
See our documentation which explains that each build step attaches to a local Docker network named |
Thanks for the link. @bendory How would I connect to this network when using, say, the - name: 'gcr.io/cloud-builders/npm:node-8.11.0'
args: ['test'] The tests require certain services to be up. |
You can do that by using a
|
@bendory thanks for that. Mounting volumes, however, doesn't seem to work. I tried the following locally hoping that steps:
- name: 'gcr.io/cloud-builders/docker'
args: [
'run',
'--rm',
'--network', 'cloudbuild',
'--volume', '/workspace:/workspace',
'node:8.11-alpine',
'sh', '-c', 'pwd && ls -lah && ls -lah /workspace'
]
- name: 'gcr.io/cloud-builders/docker'
args: [
'run',
'--rm',
'--network', 'cloudbuild',
'node:8.11-alpine',
'sh', '-c', 'pwd && ls -lah && ls -lah /workspace'
] cloud-build-local --config=cloudbuild.yaml --dryrun=false .
2018/08/06 19:00:08 Warning: The server docker version installed (18.06.0-ce-rc3) is different from the one used in GCB (17.12.0-ce)
2018/08/06 19:00:08 Warning: The client docker version installed (18.06.0-ce-rc3) is different from the one used in GCB (17.12.0-ce)
Using default tag: latest
latest: Pulling from cloud-builders/metadata
Digest: sha256:1a4ae9cbfeb9eb982c8788f1db42f80555499000cd1ce5dbfe657af9955f8812
Status: Image is up to date for gcr.io/cloud-builders/metadata:latest
2018/08/06 19:00:34 Started spoofed metadata server
2018/08/06 19:00:34 Build id = localbuild_478a3f90-ca58-400a-967f-e07fd58082c0
2018/08/06 19:00:34 status changed to "BUILD"
BUILD
Starting Step #0
Step #0: Already have image (with digest): gcr.io/cloud-builders/docker
Step #0: /
Step #0: total 64
Step #0: drwxr-xr-x 1 root root 4.0K Aug 6 18:00 .
Step #0: drwxr-xr-x 1 root root 4.0K Aug 6 18:00 ..
Step #0: -rwxr-xr-x 1 root root 0 Aug 6 18:00 .dockerenv
Step #0: drwxr-xr-x 1 root root 4.0K Jul 6 16:02 bin
Step #0: drwxr-xr-x 5 root root 340 Aug 6 18:00 dev
Step #0: drwxr-xr-x 1 root root 4.0K Aug 6 18:00 etc
Step #0: drwxr-xr-x 1 root root 4.0K Jul 6 15:55 home
Step #0: drwxr-xr-x 1 root root 4.0K Jul 5 14:47 lib
Step #0: drwxr-xr-x 5 root root 4.0K Jul 5 14:47 media
Step #0: drwxr-xr-x 2 root root 4.0K Jul 5 14:47 mnt
Step #0: drwxr-xr-x 3 root root 4.0K Jul 6 16:02 opt
Step #0: dr-xr-xr-x 237 root root 0 Aug 6 18:00 proc
Step #0: drwx------ 1 root root 4.0K Jul 6 15:55 root
Step #0: drwxr-xr-x 2 root root 4.0K Jul 5 14:47 run
Step #0: drwxr-xr-x 2 root root 4.0K Jul 5 14:47 sbin
Step #0: drwxr-xr-x 2 root root 4.0K Jul 5 14:47 srv
Step #0: dr-xr-xr-x 13 root root 0 Aug 6 18:00 sys
Step #0: drwxrwxrwt 1 root root 4.0K Jul 6 16:02 tmp
Step #0: drwxr-xr-x 1 root root 4.0K Jul 6 16:02 usr
Step #0: drwxr-xr-x 1 root root 4.0K Jul 5 14:47 var
Step #0: drwxr-xr-x 2 root root 40 Aug 6 18:00 workspace
Step #0: total 4
Step #0: drwxr-xr-x 2 root root 40 Aug 6 18:00 .
Step #0: drwxr-xr-x 1 root root 4.0K Aug 6 18:00 ..
Finished Step #0
Starting Step #1
Step #1: Already have image (with digest): gcr.io/cloud-builders/docker
Step #1: /
Step #1: total 64
Step #1: drwxr-xr-x 1 root root 4.0K Aug 6 18:00 .
Step #1: drwxr-xr-x 1 root root 4.0K Aug 6 18:00 ..
Step #1: -rwxr-xr-x 1 root root 0 Aug 6 18:00 .dockerenv
Step #1: drwxr-xr-x 1 root root 4.0K Jul 6 16:02 bin
Step #1: drwxr-xr-x 5 root root 340 Aug 6 18:00 dev
Step #1: drwxr-xr-x 1 root root 4.0K Aug 6 18:00 etc
Step #1: drwxr-xr-x 1 root root 4.0K Jul 6 15:55 home
Step #1: drwxr-xr-x 1 root root 4.0K Jul 5 14:47 lib
Step #1: drwxr-xr-x 5 root root 4.0K Jul 5 14:47 media
Step #1: drwxr-xr-x 2 root root 4.0K Jul 5 14:47 mnt
Step #1: drwxr-xr-x 3 root root 4.0K Jul 6 16:02 opt
Step #1: dr-xr-xr-x 237 root root 0 Aug 6 18:00 proc
Step #1: drwx------ 1 root root 4.0K Jul 6 15:55 root
Step #1: drwxr-xr-x 2 root root 4.0K Jul 5 14:47 run
Step #1: drwxr-xr-x 2 root root 4.0K Jul 5 14:47 sbin
Step #1: drwxr-xr-x 2 root root 4.0K Jul 5 14:47 srv
Step #1: dr-xr-xr-x 13 root root 0 Aug 6 18:00 sys
Step #1: drwxrwxrwt 1 root root 4.0K Jul 6 16:02 tmp
Step #1: drwxr-xr-x 1 root root 4.0K Jul 6 16:02 usr
Step #1: drwxr-xr-x 1 root root 4.0K Jul 5 14:47 var
Step #1: ls: /workspace: No such file or directory
Finished Step #1
2018/08/06 19:00:40 status changed to "ERROR"
ERROR
ERROR: build step 1 "gcr.io/cloud-builders/docker" failed: exit status 1
2018/08/06 19:00:42 Build finished with ERROR status
make: *** [ci] Error 1 |
@bendory , why don't the docs you referenced use |
Nevermind, I understand now. This helped a lot -> https://github.com/Philmod/gcb-docker-compose |
Bump Packer Version to 1.4.5
Hi, please see below config.
I cannot seem to reach the services started in the
docker-compose
step.Thanks,
cloudbuild.yaml:
docker-compose.yml:
Output:
The text was updated successfully, but these errors were encountered: