@@ -5,8 +5,11 @@ FROM python:${PYTHON_VERSION} AS developer
55
66# Add any system dependencies for the developer/build environment here
77RUN apt-get update && apt-get install -y --no-install-recommends \
8+ gdb \
9+ busybox \
810 graphviz \
9- && rm -rf /var/lib/apt/lists/*
11+ && rm -rf /var/lib/apt/lists/* \
12+ && busybox --install -s
1013
1114# Set up a virtual environment and put it in PATH
1215RUN python -m venv /venv
@@ -17,33 +20,40 @@ FROM developer AS build
1720# Requires buildkit 0.17.0
1821COPY --chmod=o+wrX . /workspaces/fastcs-example
1922WORKDIR /workspaces/fastcs-example
20- RUN touch dev-requirements.txt && pip install -c dev-requirements.txt .[demo]
21-
23+ RUN touch dev-requirements.txt && pip install debugpy -c dev-requirements.txt .[demo]
2224
2325FROM build AS debug
2426
25-
2627# Set origin to use ssh
2728RUN git remote set-url origin
[email protected] :DiamondLightSource/fastcs-example.git
2829
30+ # Make editable and debuggable
31+ RUN pip install debugpy -e '.[dev]'
32+ RUN chmod o+wrX /venv /workspaces
33+
34+ RUN apt-get update && \
35+ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
36+ busybox \
37+ gdb \
38+ libnss-ldapd \
39+ && rm -rf /var/lib/apt/lists/* \
40+ && busybox --install -s
2941
3042# For this pod to understand finding user information from LDAP
31- RUN apt update
32- RUN DEBIAN_FRONTEND=noninteractive apt install libnss-ldapd -y
3343RUN sed -i 's/files/ldap files/g' /etc/nsswitch.conf
3444
35- # Make editable and debuggable
36- RUN pip install debugpy
37- RUN pip install -e .
38-
39- # Alternate entrypoint to allow devcontainer to attach
40- ENTRYPOINT [ "/bin/bash" , "-c" , "--" ]
41- CMD [ "while true; do sleep 30; done;" ]
42-
45+ # Alternate entrypoint to allow restarting the IOC
46+ ENTRYPOINT [ "/bin/bash" , "-c" , "sleep infinity" ]
4347
4448# The runtime stage copies the built venv into a slim runtime container
4549FROM python:${PYTHON_VERSION}-slim AS runtime
46- # Add apt-get system dependecies for runtime here if needed
50+
51+ # Add apt-get system dependecies for runtime
52+ RUN apt-get update && apt-get install -y --no-install-recommends \
53+ gdb \
54+ && rm -rf /var/lib/apt/lists/*
55+
56+
4757COPY --from=build /venv/ /venv/
4858ENV PATH=/venv/bin:$PATH
4959
0 commit comments