Skip to content

Conversation

@jnewland
Copy link
Member

This build uses the layer cache for all steps in our Dockerfile above the ADD README.md README.md line. Since README.md has changed, all subsequent steps in the Dockerfile are executed:

starting build "2029ef3f-4048-4a9f-9111-4f946c72a6d3"

FETCHSOURCE
Fetching storage object: gs://677203284384.cloudbuild-source.googleusercontent.com/54cd8aabf8fbb06352e4f0c2ac3d4c0ed2bad6ab-06869a1a-2faf-442a-b221-9c7a3ada2262.tar.gz#1535548293395948
Copying gs://677203284384.cloudbuild-source.googleusercontent.com/54cd8aabf8fbb06352e4f0c2ac3d4c0ed2bad6ab-06869a1a-2faf-442a-b221-9c7a3ada2262.tar.gz#1535548293395948...
/ [0 files][ 0.0 B/ 1.6 KiB] 
/ [1 files][ 1.6 KiB/ 1.6 KiB] 
Operation completed over 1 objects/1.6 KiB. 
tar: Substituting `.' for empty member name
BUILD
Starting Step #0
Step #0: Already have image (with digest): gcr.io/cloud-builders/docker
Step #0: Error response from daemon: manifest for gcr.io/urcomputeringpal/cloudbuild-branch-based-caching:example-2 not found
Step #0: master: Pulling from urcomputeringpal/cloudbuild-branch-based-caching
Step #0: 8e3ba11ec2a2: Already exists
Step #0: dbb12c9c661c: Pulling fs layer
Step #0: 0341b007c935: Pulling fs layer
Step #0: 7e7f7f86258a: Pulling fs layer
Step #0: 72994e4e6a86: Pulling fs layer
Step #0: 72994e4e6a86: Waiting
Step #0: 7e7f7f86258a: Verifying Checksum
Step #0: 7e7f7f86258a: Download complete
Step #0: 0341b007c935: Verifying Checksum
Step #0: 0341b007c935: Download complete
Step #0: dbb12c9c661c: Verifying Checksum
Step #0: dbb12c9c661c: Download complete
Step #0: dbb12c9c661c: Pull complete
Step #0: 0341b007c935: Pull complete
Step #0: 72994e4e6a86: Verifying Checksum
Step #0: 72994e4e6a86: Download complete
Step #0: 7e7f7f86258a: Pull complete
Step #0: 72994e4e6a86: Pull complete
Step #0: Digest: sha256:96babe6faab5a5ca4e1fa4ebfd35ab493b5dc44c342585bcda6a04eb7ec90989
Step #0: Status: Downloaded newer image for gcr.io/urcomputeringpal/cloudbuild-branch-based-caching:master
Finished Step #0
Starting Step #1
Step #1: Already have image (with digest): gcr.io/cloud-builders/docker
Step #1: Sending build context to Docker daemon 7.68kB

Step #1: Step 1/6 : FROM alpine
Step #1: latest: Pulling from library/alpine
Step #1: Digest: sha256:0873c923e00e0fd2ba78041bfb64a105e1ecb7678916d1f7776311e45bf5634b
Step #1: Status: Downloaded newer image for alpine:latest
Step #1: ---> 11cd0b38bc3c
Step #1: Step 2/6 : WORKDIR /app
Step #1: ---> Using cache
Step #1: ---> 7212ccc34a7c
Step #1: Step 3/6 : ADD README.md README.md
Step #1: ---> a00c7068347a
Step #1: Step 4/6 : RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
Step #1: ---> Running in 85a581094eca
Step #1: fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
Step #1: fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
Step #1: v3.8.0-95-g244b823930 [http://dl-cdn.alpinelinux.org/alpine/v3.8/main]
Step #1: v3.8.0-95-g244b823930 [http://dl-cdn.alpinelinux.org/alpine/v3.8/community]
Step #1: OK: 9542 distinct packages available
Step #1: (1/1) Installing ca-certificates (20171114-r3)
Step #1: Executing busybox-1.28.4-r0.trigger
Step #1: Executing ca-certificates-20171114-r3.trigger
Step #1: OK: 5 MiB in 14 packages
Step #1: Removing intermediate container 85a581094eca
Step #1: ---> aad81075a6b2
Step #1: Step 5/6 : ADD run.sh run.sh
Step #1: ---> 0c545410f69b
Step #1: Step 6/6 : ENTRYPOINT ["/app/run.sh"]
Step #1: ---> Running in 9ef85f730a20
Step #1: Removing intermediate container 9ef85f730a20
Step #1: ---> 2dd89ba100c7
Step #1: Successfully built 2dd89ba100c7
Step #1: Successfully tagged gcr.io/urcomputeringpal/cloudbuild-branch-based-caching:example-2
Step #1: Successfully tagged gcr.io/urcomputeringpal/cloudbuild-branch-based-caching:54cd8aabf8fbb06352e4f0c2ac3d4c0ed2bad6ab
Finished Step #1
PUSH
Pushing gcr.io/urcomputeringpal/cloudbuild-branch-based-caching:example-2
The push refers to repository [gcr.io/urcomputeringpal/cloudbuild-branch-based-caching]
f8d0b348568a: Preparing
b004ac694d5d: Preparing
7f565aa32c3f: Preparing
9a20ec34bec2: Preparing
73046094a9b8: Preparing
73046094a9b8: Layer already exists
9a20ec34bec2: Layer already exists
7f565aa32c3f: Pushed
b004ac694d5d: Pushed
f8d0b348568a: Pushed
example-2: digest: sha256:4394ce600f376b8e78d42e3d3897133ba7804d4876cadc342cf3c1ea660b30e3 size: 1359
Pushing gcr.io/urcomputeringpal/cloudbuild-branch-based-caching:54cd8aabf8fbb06352e4f0c2ac3d4c0ed2bad6ab
The push refers to repository [gcr.io/urcomputeringpal/cloudbuild-branch-based-caching]
f8d0b348568a: Preparing
b004ac694d5d: Preparing
7f565aa32c3f: Preparing
9a20ec34bec2: Preparing
73046094a9b8: Preparing
f8d0b348568a: Layer already exists
7f565aa32c3f: Layer already exists
b004ac694d5d: Layer already exists
9a20ec34bec2: Layer already exists
73046094a9b8: Layer already exists
54cd8aabf8fbb06352e4f0c2ac3d4c0ed2bad6ab: digest: sha256:4394ce600f376b8e78d42e3d3897133ba7804d4876cadc342cf3c1ea660b30e3 size: 1359
DONE

@jnewland
Copy link
Member Author

dfc2370 changes run.sh on this branch. Its build demonstrates how each branch maintains its own layer cache - even though both README.md and run.sh have now changed on this branch, the build for dfc2370 leveraged the build cache created by the build of 54cd8aa:

starting build "aee435f0-d493-469f-a1ce-ae90c4594ee0"

FETCHSOURCE
Fetching storage object: gs://677203284384.cloudbuild-source.googleusercontent.com/dfc2370f3f82a6a09b8666bb0322d0f0d6b27b66-72189eba-3d3a-482a-8eb6-510e86e61ae9.tar.gz#1535548699402138
Copying gs://677203284384.cloudbuild-source.googleusercontent.com/dfc2370f3f82a6a09b8666bb0322d0f0d6b27b66-72189eba-3d3a-482a-8eb6-510e86e61ae9.tar.gz#1535548699402138...
/ [0 files][ 0.0 B/ 1.6 KiB] 
/ [1 files][ 1.6 KiB/ 1.6 KiB] 
Operation completed over 1 objects/1.6 KiB. 
tar: Substituting `.' for empty member name
BUILD
Starting Step #0
Step #0: Already have image (with digest): gcr.io/cloud-builders/docker
Step #0: example-2: Pulling from urcomputeringpal/cloudbuild-branch-based-caching
Step #0: 8e3ba11ec2a2: Already exists
Step #0: dbb12c9c661c: Pulling fs layer
Step #0: f18cac60ee69: Pulling fs layer
Step #0: d5b208066928: Pulling fs layer
Step #0: 1042d7d9fc0d: Pulling fs layer
Step #0: 1042d7d9fc0d: Waiting
Step #0: f18cac60ee69: Verifying Checksum
Step #0: f18cac60ee69: Download complete
Step #0: dbb12c9c661c: Verifying Checksum
Step #0: dbb12c9c661c: Download complete
Step #0: d5b208066928: Verifying Checksum
Step #0: d5b208066928: Download complete
Step #0: dbb12c9c661c: Pull complete
Step #0: f18cac60ee69: Pull complete
Step #0: 1042d7d9fc0d: Verifying Checksum
Step #0: 1042d7d9fc0d: Download complete
Step #0: d5b208066928: Pull complete
Step #0: 1042d7d9fc0d: Pull complete
Step #0: Digest: sha256:4394ce600f376b8e78d42e3d3897133ba7804d4876cadc342cf3c1ea660b30e3
Step #0: Status: Downloaded newer image for gcr.io/urcomputeringpal/cloudbuild-branch-based-caching:example-2
Step #0: master: Pulling from urcomputeringpal/cloudbuild-branch-based-caching
Step #0: 8e3ba11ec2a2: Already exists
Step #0: dbb12c9c661c: Already exists
Step #0: 0341b007c935: Pulling fs layer
Step #0: 7e7f7f86258a: Pulling fs layer
Step #0: 72994e4e6a86: Pulling fs layer
Step #0: 0341b007c935: Verifying Checksum
Step #0: 0341b007c935: Download complete
Step #0: 72994e4e6a86: Verifying Checksum
Step #0: 72994e4e6a86: Download complete
Step #0: 7e7f7f86258a: Verifying Checksum
Step #0: 7e7f7f86258a: Download complete
Step #0: 0341b007c935: Pull complete
Step #0: 7e7f7f86258a: Pull complete
Step #0: 72994e4e6a86: Pull complete
Step #0: Digest: sha256:96babe6faab5a5ca4e1fa4ebfd35ab493b5dc44c342585bcda6a04eb7ec90989
Step #0: Status: Downloaded newer image for gcr.io/urcomputeringpal/cloudbuild-branch-based-caching:master
Finished Step #0
Starting Step #1
Step #1: Already have image (with digest): gcr.io/cloud-builders/docker
Step #1: Sending build context to Docker daemon 7.68kB

Step #1: Step 1/6 : FROM alpine
Step #1: latest: Pulling from library/alpine
Step #1: Digest: sha256:0873c923e00e0fd2ba78041bfb64a105e1ecb7678916d1f7776311e45bf5634b
Step #1: Status: Downloaded newer image for alpine:latest
Step #1: ---> 11cd0b38bc3c
Step #1: Step 2/6 : WORKDIR /app
Step #1: ---> Using cache
Step #1: ---> 7212ccc34a7c
Step #1: Step 3/6 : ADD README.md README.md
Step #1: ---> Using cache
Step #1: ---> 42e3fe19606d
Step #1: Step 4/6 : RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
Step #1: ---> Using cache
Step #1: ---> 931315c874ba
Step #1: Step 5/6 : ADD run.sh run.sh
Step #1: ---> 8eac5384709e
Step #1: Step 6/6 : ENTRYPOINT ["/app/run.sh"]
Step #1: ---> Running in fbb5c8950328
Step #1: Removing intermediate container fbb5c8950328
Step #1: ---> ca754dd5e0a5
Step #1: Successfully built ca754dd5e0a5
Step #1: Successfully tagged gcr.io/urcomputeringpal/cloudbuild-branch-based-caching:example-2
Step #1: Successfully tagged gcr.io/urcomputeringpal/cloudbuild-branch-based-caching:dfc2370f3f82a6a09b8666bb0322d0f0d6b27b66
Finished Step #1
PUSH
Pushing gcr.io/urcomputeringpal/cloudbuild-branch-based-caching:example-2
The push refers to repository [gcr.io/urcomputeringpal/cloudbuild-branch-based-caching]
951aa4cef3e6: Preparing
b004ac694d5d: Preparing
7f565aa32c3f: Preparing
9a20ec34bec2: Preparing
73046094a9b8: Preparing
9a20ec34bec2: Layer already exists
7f565aa32c3f: Layer already exists
b004ac694d5d: Layer already exists
73046094a9b8: Layer already exists
951aa4cef3e6: Pushed
example-2: digest: sha256:760ed1f1b93bea5da34570aaf1f228b910392636b9bf256c9652a42a67747fac size: 1359
Pushing gcr.io/urcomputeringpal/cloudbuild-branch-based-caching:dfc2370f3f82a6a09b8666bb0322d0f0d6b27b66
The push refers to repository [gcr.io/urcomputeringpal/cloudbuild-branch-based-caching]
951aa4cef3e6: Preparing
b004ac694d5d: Preparing
7f565aa32c3f: Preparing
9a20ec34bec2: Preparing
73046094a9b8: Preparing
9a20ec34bec2: Layer already exists
951aa4cef3e6: Layer already exists
7f565aa32c3f: Layer already exists
b004ac694d5d: Layer already exists
73046094a9b8: Layer already exists
dfc2370f3f82a6a09b8666bb0322d0f0d6b27b66: digest: sha256:760ed1f1b93bea5da34570aaf1f228b910392636b9bf256c9652a42a67747fac size: 1359
DONE

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants