Skip to content

Instantly share code, notes, and snippets.

@ento
Created May 29, 2023 20:33
Show Gist options
  • Save ento/ee0e7ca020d85a4f58c74be8d093502b to your computer and use it in GitHub Desktop.
Save ento/ee0e7ca020d85a4f58c74be8d093502b to your computer and use it in GitHub Desktop.
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 1.14kB done
#1 DONE 0.0s
#2 [internal] load .dockerignore
#2 transferring context: 2B done
#2 DONE 0.0s
#3 [internal] load metadata for docker.io/library/python:3.9-slim
#3 ...
#4 [internal] load metadata for docker.io/library/busybox:latest
#4 DONE 0.4s
#3 [internal] load metadata for docker.io/library/python:3.9-slim
#3 DONE 0.4s
#5 [base 1/3] FROM docker.io/library/python:3.9-slim@sha256:5cde4e147c4165ad8dbf8a4df9631863766eeb0b79b890fafe6885b3b127af74
#5 DONE 0.0s
#6 [stage-3 1/6] FROM docker.io/library/busybox@sha256:560af6915bfc8d7630e50e212e08242d37b63bd5c1ccf9bd4acccf116e262d5b
#6 DONE 0.0s
#7 [env_b 2/2] RUN find example_repo/helloworld -ls
#7 CACHED
#8 [stage-3 4/6] RUN cd from_a && sha256sum pex_binary.pex | tee sha256sum.txt && sha256sum -c sha256sum.txt
#8 CACHED
#9 [stage-3 2/6] COPY --from=env_a /example_repo/dist/helloworld/pex_binary.pex from_a/pex_binary.pex
#9 CACHED
#10 [base 3/3] RUN curl --proto '=https' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh | bash
#10 CACHED
#11 [stage-3 3/6] COPY --from=env_b /example_repo/dist/helloworld/pex_binary.pex from_b/pex_binary.pex
#11 CACHED
#12 [env_b 1/2] RUN umask 002 && git clone https://github.com/pantsbuild/example-python example_repo && cd example_repo && git checkout 3de75f5 && PATH=$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin pants package ::
#12 CACHED
#13 [env_a 1/2] RUN umask 022 && git clone https://github.com/pantsbuild/example-python example_repo && cd example_repo && git checkout 3de75f5 && PATH=$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin pants package ::
#13 CACHED
#14 [env_a 2/2] RUN find example_repo/helloworld -ls
#14 CACHED
#15 [base 2/3] RUN apt-get update && apt-get install -y curl git
#15 CACHED
#16 [stage-3 5/6] RUN cd from_b && sha256sum pex_binary.pex | tee sha256sum.txt && sha256sum -c sha256sum.txt
#16 CACHED
#17 [stage-3 6/6] RUN cd from_b && sha256sum -c ../from_a/sha256sum.txt
#17 0.281 pex_binary.pex: FAILED
#17 0.281 sha256sum: WARNING: 1 of 1 computed checksums did NOT match
#17 ERROR: process "/bin/sh -c cd from_b && sha256sum -c ../from_a/sha256sum.txt" did not complete successfully: exit code: 1
------
> [stage-3 6/6] RUN cd from_b && sha256sum -c ../from_a/sha256sum.txt:
#17 0.281 pex_binary.pex: FAILED
#17 0.281 sha256sum: WARNING: 1 of 1 computed checksums did NOT match
------
Dockerfile:30
--------------------
29 | && sha256sum -c sha256sum.txt
30 | >>> RUN cd from_b \
31 | >>> && sha256sum -c ../from_a/sha256sum.txt
32 |
--------------------
ERROR: failed to solve: process "/bin/sh -c cd from_b && sha256sum -c ../from_a/sha256sum.txt" did not complete successfully: exit code: 1
FROM python:3.9-slim AS base
RUN apt-get update && apt-get install -y curl git
RUN curl --proto '=https' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh | bash
FROM base as env_a
RUN umask 022 \
&& git clone https://github.com/pantsbuild/example-python example_repo \
&& cd example_repo \
&& git checkout 3de75f5 \
&& PATH=$HOME/bin:$PATH pants package ::
RUN find example_repo/helloworld -ls
FROM base as env_b
RUN umask 002 \
&& git clone https://github.com/pantsbuild/example-python example_repo \
&& cd example_repo \
&& git checkout 3de75f5 \
&& PATH=$HOME/bin:$PATH pants package ::
RUN find example_repo/helloworld -ls
FROM busybox
COPY --from=env_a /example_repo/dist/helloworld/pex_binary.pex from_a/pex_binary.pex
COPY --from=env_b /example_repo/dist/helloworld/pex_binary.pex from_b/pex_binary.pex
RUN cd from_a \
&& sha256sum pex_binary.pex | tee sha256sum.txt \
&& sha256sum -c sha256sum.txt
RUN cd from_b \
&& sha256sum pex_binary.pex | tee sha256sum.txt \
&& sha256sum -c sha256sum.txt
RUN cd from_b \
&& sha256sum -c ../from_a/sha256sum.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment