1
1
FROM ubuntu:22.04
2
2
3
+ # switch to root, let the entrypoint drop back to host user
4
+ USER root
5
+
3
6
ARG DEBIAN_FRONTEND=noninteractive
4
7
5
8
RUN : \
@@ -34,6 +37,13 @@ RUN : \
34
37
&& rm -rf /var/lib/apt/lists/* \
35
38
&& :
36
39
40
+ # install gosu for a better su+exec command
41
+ ARG GOSU_VERSION=1.17
42
+ RUN dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
43
+ && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \
44
+ && chmod +x /usr/local/bin/gosu \
45
+ && gosu nobody true
46
+
37
47
# To build the image for a branch or a tag of the lib-builder, pass --build-arg LIBBUILDER_CLONE_BRANCH_OR_TAG=name.
38
48
# To build the image with a specific commit ID of lib-builder, pass --build-arg LIBBUILDER_CHECKOUT_REF=commit-id.
39
49
# It is possibe to combine both, e.g.:
@@ -51,6 +61,7 @@ ARG LIBBUILDER_CLONE_SHALLOW_DEPTH=1
51
61
ARG LIBBUILDER_TARGETS=all
52
62
53
63
ENV LIBBUILDER_PATH=/opt/esp/lib-builder
64
+ ENV ARDUINO_PATH=/opt/esp/lib-builder/arduino-esp32
54
65
55
66
RUN echo LIBBUILDER_CHECKOUT_REF=$LIBBUILDER_CHECKOUT_REF LIBBUILDER_CLONE_BRANCH_OR_TAG=$LIBBUILDER_CLONE_BRANCH_OR_TAG && \
56
67
git clone --recursive \
@@ -67,10 +78,10 @@ RUN echo LIBBUILDER_CHECKOUT_REF=$LIBBUILDER_CHECKOUT_REF LIBBUILDER_CLONE_BRANC
67
78
git submodule update --init --recursive; \
68
79
fi
69
80
70
- RUN cp $LIBBUILDER_PATH/tools/docker/ entrypoint.sh $LIBBUILDER_PATH/entrypoint.sh
81
+ COPY entrypoint.sh $LIBBUILDER_PATH/entrypoint.sh
71
82
72
83
# Ccache is installed, enable it by default
73
84
ENV IDF_CCACHE_ENABLE=1
74
85
75
- WORKDIR $LIBBUILDER_PATH
76
- ENTRYPOINT [ "$LIBBUILDER_PATH /entrypoint.sh" ]
86
+ WORKDIR /opt/esp/lib-builder
87
+ ENTRYPOINT [ "/opt/esp/lib-builder /entrypoint.sh" ]
0 commit comments