11FROM ubuntu:22.04
22
3+ # switch to root, let the entrypoint drop back to host user
4+ USER root
5+
36ARG DEBIAN_FRONTEND=noninteractive
47
58RUN : \
@@ -34,6 +37,13 @@ RUN : \
3437 && rm -rf /var/lib/apt/lists/* \
3538 && :
3639
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+
3747# To build the image for a branch or a tag of the lib-builder, pass --build-arg LIBBUILDER_CLONE_BRANCH_OR_TAG=name.
3848# To build the image with a specific commit ID of lib-builder, pass --build-arg LIBBUILDER_CHECKOUT_REF=commit-id.
3949# It is possibe to combine both, e.g.:
@@ -51,6 +61,7 @@ ARG LIBBUILDER_CLONE_SHALLOW_DEPTH=1
5161ARG LIBBUILDER_TARGETS=all
5262
5363ENV LIBBUILDER_PATH=/opt/esp/lib-builder
64+ ENV ARDUINO_PATH=/opt/esp/lib-builder/arduino-esp32
5465
5566RUN echo LIBBUILDER_CHECKOUT_REF=$LIBBUILDER_CHECKOUT_REF LIBBUILDER_CLONE_BRANCH_OR_TAG=$LIBBUILDER_CLONE_BRANCH_OR_TAG && \
5667 git clone --recursive \
@@ -67,10 +78,10 @@ RUN echo LIBBUILDER_CHECKOUT_REF=$LIBBUILDER_CHECKOUT_REF LIBBUILDER_CLONE_BRANC
6778 git submodule update --init --recursive; \
6879 fi
6980
70- RUN cp $LIBBUILDER_PATH/tools/docker/ entrypoint.sh $LIBBUILDER_PATH/entrypoint.sh
81+ COPY entrypoint.sh $LIBBUILDER_PATH/entrypoint.sh
7182
7283# Ccache is installed, enable it by default
7384ENV IDF_CCACHE_ENABLE=1
7485
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