Skip to content

Instantly share code, notes, and snippets.

@0xAhmed
Last active October 10, 2017 13:18
Show Gist options
  • Save 0xAhmed/c3efd5a036cb1b0879f47e230b9c4d20 to your computer and use it in GitHub Desktop.
Save 0xAhmed/c3efd5a036cb1b0879f47e230b9c4d20 to your computer and use it in GitHub Desktop.
Build Docker image for 2.0 and push to GCR
$ export app_version=2.0
$ docker build --build-arg version=$app_version -t gcr.io/$PROJECT_ID/app:$app_version .
Sending build context to Docker daemon 16.48MB
Step 1/6 : FROM alpine:latest
---> 7328f6f8b418
Step 2/6 : MAINTAINER The Dockbit Team "team@dockbit.com"
---> Using cache
---> 6abecc069f97
Step 3/6 : ARG version=1.0
---> Using cache
---> d486d81470ff
Step 4/6 : COPY source/$version/app /app
---> f78c9f9d2e78
Removing intermediate container e18187a82f95
Step 5/6 : EXPOSE 8080
---> Running in 564b1fc9a62b
---> ea31e9bf6605
Removing intermediate container 564b1fc9a62b
Step 6/6 : ENTRYPOINT /app
---> Running in 4fb23e91e8b3
---> fcd6a752131f
Removing intermediate container 4fb23e91e8b3
Successfully built fcd6a752131f
Successfully tagged gcr.io/project-canary-181811/app:2.0
$ gcloud docker -- push gcr.io/$PROJECT_ID/app:$app_version
The push refers to a repository [gcr.io/project-canary-181811/app]
a02d26201799: Pushed
5bef08742407: Layer already exists
2.0: digest: sha256:ba1514d99861beb78bf74e434859691173099f30b3b6d316fc791ff51741b3d7 size: 739
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment