Skip to content

Commit 81db753

Browse files
committed
highlight stages with comments
1 parent 7be83d2 commit 81db753

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# The devcontainer should use the developer target and run as root with podman
22
# or docker with user namespaces.
33
ARG PYTHON_VERSION=3.11
4+
5+
# The developer is used by devcontainers ###############################################
46
FROM python:${PYTHON_VERSION} AS developer
57

68
# Add any system dependencies for the developer/build environment here
@@ -15,13 +17,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1517
RUN python -m venv /venv
1618
ENV PATH=/venv/bin:$PATH
1719

18-
# The build stage installs the context into the venv
20+
# The build stage installs the context into the venv ###################################
1921
FROM developer AS build
22+
2023
# Requires buildkit 0.17.0
2124
COPY --chmod=o+wrX . /workspaces/fastcs-example
2225
WORKDIR /workspaces/fastcs-example
2326
RUN touch dev-requirements.txt && pip install debugpy -c dev-requirements.txt .[demo]
2427

28+
# The debug stage allows for debugging and development #################################
2529
FROM build AS debug
2630

2731
# Set origin to use ssh
@@ -45,15 +49,14 @@ RUN sed -i 's/files/ldap files/g' /etc/nsswitch.conf
4549
# Alternate entrypoint to allow restarting the IOC
4650
ENTRYPOINT [ "/bin/bash", "-c", "sleep infinity" ]
4751

48-
# The runtime stage copies the built venv into a slim runtime container
52+
# The runtime stage has built venv only ################################################
4953
FROM python:${PYTHON_VERSION}-slim AS runtime
5054

5155
# Add apt-get system dependecies for runtime
5256
RUN apt-get update && apt-get install -y --no-install-recommends \
5357
gdb \
5458
&& rm -rf /var/lib/apt/lists/*
5559

56-
5760
COPY --from=build /venv/ /venv/
5861
ENV PATH=/venv/bin:$PATH
5962

0 commit comments

Comments
 (0)