Skip to content

Commit cd6f3bd

Browse files
committed
Test docker Image
1 parent fbf8143 commit cd6f3bd

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed

tools/docker/Dockerfile

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
FROM ubuntu:22.04
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
5+
RUN : \
6+
&& apt-get update \
7+
&& apt-get install -y --no-install-recommends \
8+
git \
9+
wget \
10+
curl \
11+
libssl-dev \
12+
libncurses-dev \
13+
flex \
14+
bison \
15+
gperf \
16+
python3 \
17+
python3-pip \
18+
python3-setuptools \
19+
python3-serial \
20+
python3-click \
21+
python3-cryptography \
22+
python3-future \
23+
python3-pyparsing \
24+
python3-pyelftools \
25+
cmake \
26+
ninja-build \
27+
ccache \
28+
jq \
29+
&& pip install --upgrade pip \
30+
&& apt-get autoremove -y \
31+
&& rm -rf /var/lib/apt/lists/* \
32+
&& :
33+
34+
# To build the image for a branch or a tag of the lib-builder, pass --build-arg LIBBUILDER_CLONE_BRANCH_OR_TAG=name.
35+
# To build the image with a specific commit ID of lib-builder, pass --build-arg LIBBUILDER_CHECKOUT_REF=commit-id.
36+
# It is possibe to combine both, e.g.:
37+
# LIBBUILDER_CLONE_BRANCH_OR_TAG=release/vX.Y
38+
# LIBBUILDER_CHECKOUT_REF=<some commit on release/vX.Y branch>.
39+
# Use LIBBUILDER_CLONE_SHALLOW=1 to peform shallow clone (i.e. --depth=1 --shallow-submodules)
40+
# Use LIBBUILDER_CLONE_SHALLOW_DEPTH=X to define the depth if LIBBUILDER_CLONE_SHALLOW is used (i.e. --depth=X)
41+
# Use IDF_INSTALL_TARGETS to install tools only for selected chip targets (CSV)
42+
43+
ARG LIBBUILDER_CLONE_URL=https://github.com/espressif/esp32-arduino-lib-builder
44+
ARG LIBBUILDER_CLONE_BRANCH_OR_TAG=master
45+
ARG LIBBUILDER_CHECKOUT_REF=
46+
ARG LIBBUILDER_CLONE_SHALLOW=
47+
ARG LIBBUILDER_CLONE_SHALLOW_DEPTH=1
48+
ARG LIBBUILDER_TARGETS=all
49+
50+
ENV LIBBUILDER_PATH=/opt/esp/lib-builder
51+
52+
RUN echo LIBBUILDER_CHECKOUT_REF=$LIBBUILDER_CHECKOUT_REF LIBBUILDER_CLONE_BRANCH_OR_TAG=$LIBBUILDER_CLONE_BRANCH_OR_TAG && \
53+
git clone --recursive \
54+
${LIBBUILDER_CLONE_SHALLOW:+--depth=${LIBBUILDER_CLONE_SHALLOW_DEPTH} --shallow-submodules} \
55+
${LIBBUILDER_CLONE_BRANCH_OR_TAG:+-b $LIBBUILDER_CLONE_BRANCH_OR_TAG} \
56+
$LIBBUILDER_CLONE_URL $LIBBUILDER_PATH && \
57+
git config --system --add safe.directory $LIBBUILDER_PATH && \
58+
if [ -n "$LIBBUILDER_CHECKOUT_REF" ]; then \
59+
cd $LIBBUILDER_PATH && \
60+
if [ -n "$LIBBUILDER_CLONE_SHALLOW" ]; then \
61+
git fetch origin --depth=${LIBBUILDER_CLONE_SHALLOW_DEPTH} --recurse-submodules ${LIBBUILDER_CHECKOUT_REF}; \
62+
fi && \
63+
git checkout $LIBBUILDER_CHECKOUT_REF && \
64+
git submodule update --init --recursive; \
65+
fi
66+
67+
RUN cp $LIBBUILDER_PATH/tools/docker/entrypoint.sh $LIBBUILDER_PATH/entrypoint.sh
68+
69+
# Ccache is installed, enable it by default
70+
ENV IDF_CCACHE_ENABLE=1
71+
72+
WORKDIR $LIBBUILDER_PATH
73+
ENTRYPOINT [ "$LIBBUILDER_PATH/entrypoint.sh" ]

tools/docker/entrypoint.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
# LIBBUILDER_GIT_SAFE_DIR has the same format as system PATH environment variable.
5+
# All path specified in LIBBUILDER_GIT_SAFE_DIR will be added to user's
6+
# global git config as safe.directory paths. For more information
7+
# see git-config manual page.
8+
if [ -n "${LIBBUILDER_GIT_SAFE_DIR+x}" ]
9+
then
10+
echo "Adding following directories into git's safe.directory"
11+
echo "$LIBBUILDER_GIT_SAFE_DIR" | tr ':' '\n' | while read -r dir
12+
do
13+
git config --global --add safe.directory "$dir"
14+
echo " $dir"
15+
done
16+
fi
17+
18+
exec "$@"

0 commit comments

Comments
 (0)