Skip to content

Instantly share code, notes, and snippets.

@nealeu
Last active August 22, 2019 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nealeu/8c8e68aaa7355dcd0dd2930eee44e8e7 to your computer and use it in GitHub Desktop.
Save nealeu/8c8e68aaa7355dcd0dd2930eee44e8e7 to your computer and use it in GitHub Desktop.
Fake metdata.google.internal for GCP images with docker-compose
version: "3"
services:
metadata0:
image: nginx:alpine
volumes:
- ./metadata-db0:/usr/share/nginx/html:ro
command: [nginx-debug, '-g', 'daemon off;']
db0:
links:
- metadata0:metadata.google.internal
image: gcr.io/some-project/some_gcp_image:v1
metadata1:
image: nginx:alpine
volumes:
- ./metadata-db1:/usr/share/nginx/html:ro
command: [nginx-debug, '-g', 'daemon off;']
db1:
links:
- metadata1:metadata.google.internal
image: gcr.io/some-project/some_gcp_image:v1
@nealeu
Copy link
Author

nealeu commented Aug 19, 2019

Sometimes you might want to spin up a few containers that are GCP aware and pull their config from metadata.google.internal.

This should be sufficient to get a static setup, but perhaps there are better ways that work with docker-compose scaling for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment