better-van-82973
08/04/2023, 2:15 PMsrcs
and deps
images to build correctly, but when trying to build the final combined image I get the following error:
#3 [internal] load metadata for myrepo:srcs
#3 ERROR: myrepo:srcs: not found
But when I run docker images
, the images definitely exist:
myrepo deps 491bcdc66b66 23 hours ago 560MB
myrepo srcs 5b5af6a920cd 23 hours ago 159MB
Is there some other step I forgot before building the final image?better-van-82973
08/04/2023, 2:16 PMdocker_image(
name="img-deps",
registries=[],
repository="myrepo",
image_tags=["deps"],
skip_push=True,
instructions=[
"FROM --platform=linux/amd64 python:3.10-slim AS deps",
"COPY api.src.py.api/binary-deps.pex /binary-deps.pex",
"RUN PEX_TOOLS=1 /usr/local/bin/python3.10 /binary-deps.pex venv --scope=deps --compile /bin/app",
]
)
docker_image(
name="img-srcs",
registries=[],
repository="myrepo",
image_tags=["srcs"],
skip_push=True,
instructions=[
"FROM --platform=linux/amd64 python:3.10-slim as srcs",
"COPY api.src.py.api/binary-srcs.pex /binary-srcs.pex",
"RUN PEX_TOOLS=1 /usr/local/bin/python3.10 /binary-srcs.pex venv --scope=srcs --compile /bin/app",
]
)
docker_image(
name="img",
dependencies=[":img-srcs", ":img-deps"],
registries=["@aws"],
repository="myrepo",
image_tags=["{build_args.TAG}"],
instructions=[
"FROM --platform=linux/amd64 python:3.10-slim",
"RUN apt-get update && apt-get install -y procps build-essential python3-dev libpq-dev",
'ENTRYPOINT ["/bin/app/pex"]',
"COPY --from=myrepo:srcs /bin/app /bin/app",
"COPY --from=myrepo:deps /bin/app /bin/app",
"EXPOSE 80",
],
)
bitter-ability-32190
08/04/2023, 2:17 PMbitter-ability-32190
08/04/2023, 2:19 PMinstructions = [
"FROM companyname/app:deps as deps",
"FROM companyname/app:srcs as srcs",
"FROM python:3.10-slim",
'ENTRYPOINT ["/bin/app/pex"]',
"COPY --from=deps /bin/app /bin/app",
"COPY --from=srcs /bin/app /bin/app",
]
bitter-ability-32190
08/04/2023, 2:19 PMbetter-van-82973
08/04/2023, 2:19 PMbetter-van-82973
08/04/2023, 2:19 PMbitter-ability-32190
08/04/2023, 2:20 PMbetter-van-82973
08/04/2023, 2:21 PMhappy-kitchen-89482
08/04/2023, 3:55 PM