File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 1
- FROM debian:12-slim as build
1
+ FROM debian:12-slim AS build
2
2
ARG VERSION=9.2.1
3
3
ARG VARIANT=container
4
- ARG MICROPYPATH=/ciruitpy/lib
5
4
6
5
# Install system requirements
7
6
RUN apt update \
@@ -20,16 +19,18 @@ COPY variants/ /circuitpython/ports/unix/variants/
20
19
RUN make -C mpy-cross \
21
20
&& VARIANT=$VARIANT BUILD=build make -C ports/unix
22
21
23
- # Create final runtime container
24
- FROM debian:12-slim
22
+ # Create a base image primarily for CI/CD pipelines runners
23
+ FROM debian:12-slim AS base
25
24
COPY --from=build /circuitpython/mpy-cross/build/mpy-cross /usr/local/bin/mpy-cross
26
25
COPY --from=build /circuitpython/ports/unix/build/micropython /usr/local/bin/micropython
27
- # Setup non-root runtime user
26
+ ENTRYPOINT ["/usr/local/bin/micropython" ]
27
+
28
+ # Set up non-root runtime user for everyone else
29
+ FROM base AS runtime
28
30
RUN useradd -Md /circuitpy circuitpy \
29
31
&& mkdir /circuitpy \
30
32
&& chown circuitpy:circuitpy /circuitpy
31
33
USER circuitpy
32
34
WORKDIR /circuitpy
33
35
# Load libraries from the working directory
34
- ENV MICROPYPATH=$MICROPYPATH
35
- ENTRYPOINT ["/usr/local/bin/micropython" ]
36
+ ENV MICROPYPATH=/ciruitpy/lib
You can’t perform that action at this time.
0 commit comments