diff --git a/Docker/Dockerfile b/Docker/Dockerfile index 835d4783c..388169e6d 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -18,6 +18,9 @@ ARG UID=1000 ARG GID=1000 RUN groupadd -f -g ${GID} docker && ( getent passwd ${UID} || useradd -ms /bin/bash ${USER} -u ${UID} -g ${GID} ) +# Add github.com as an SSH known host +RUN ssh -o StrictHostKeyChecking=no -T git@github.com; cat ~/.ssh/known_hosts >> /etc/ssh/ssh_known_hosts + # install ccache RUN mkdir -p /opt/ccache/bin && for prog in gcc g++ cc c++ cpp arm-none-eabi-c++ arm-none-eabi-cpp arm-none-eabi-gcc arm-none-eabi-g++; do ln -s /usr/bin/ccache /opt/ccache/bin/$(basename $prog); done ENV PATH /opt/ccache/bin:$PATH @@ -44,4 +47,7 @@ RUN setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' /usr/bin/tcpdump # Allow non-root to use gdb on processes (will need SYS_PTRACE capability when running the container) RUN setcap 'CAP_SYS_PTRACE+eip' /usr/bin/gdb -USER ${UID}:${GID} \ No newline at end of file +# Add in Jenkins userID +RUN for i in $(seq 1001 1010); do ( getent passwd ${i} || useradd -ms /bin/bash jenkins${i} -u ${i} -g ${GID} ); done + +USER ${UID}:${GID} diff --git a/Docker/Dockerfile.cross-compiler b/Docker/Dockerfile.cross-compiler index 6819f3fc7..ed668501f 100644 --- a/Docker/Dockerfile.cross-compiler +++ b/Docker/Dockerfile.cross-compiler @@ -8,11 +8,4 @@ RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y apt-utils \ && apt install -y ${DEPS_TESTING} \ && apt clean -y && rm -rf /var/lib/apt/lists/* -ARG JENKINS_UID=1009 -ARG JENKINS_GID=1010 -RUN groupadd -f -g ${JENKINS_GID} jenkins && ( getent passwd ${JENKINS_UID} || useradd -ms /bin/bash jenkins -u ${JENKINS_UID} -g ${JENKINS_GID} ) - -# Add github.com as an SSH known host -RUN ssh -o StrictHostKeyChecking=no -T git@github.com; cat ~/.ssh/known_hosts >> /etc/ssh/ssh_known_hosts - USER docker