Skip to content

Commit 717249c

Browse files
author
Andras Fekete
committed
Trust github.com in container, add in possible Jenkins userIDs
1 parent f0d0a87 commit 717249c

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

Docker/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ ARG UID=1000
1818
ARG GID=1000
1919
RUN groupadd -f -g ${GID} docker && ( getent passwd ${UID} || useradd -ms /bin/bash ${USER} -u ${UID} -g ${GID} )
2020

21+
# Add github.com as an SSH known host
22+
RUN ssh -o StrictHostKeyChecking=no -T git@github.com; cat ~/.ssh/known_hosts >> /etc/ssh/ssh_known_hosts
23+
2124
# install ccache
2225
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
2326
ENV PATH /opt/ccache/bin:$PATH
@@ -44,4 +47,7 @@ RUN setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' /usr/bin/tcpdump
4447
# Allow non-root to use gdb on processes (will need SYS_PTRACE capability when running the container)
4548
RUN setcap 'CAP_SYS_PTRACE+eip' /usr/bin/gdb
4649

47-
USER ${UID}:${GID}
50+
# Add in Jenkins userID
51+
RUN for i in $(seq 1001 1010); do ( getent passwd ${i} || useradd -ms /bin/bash jenkins${i} -u ${i} -g ${GID} ); done
52+
53+
USER ${UID}:${GID}

Docker/Dockerfile.cross-compiler

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,4 @@ RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y apt-utils \
88
&& apt install -y ${DEPS_TESTING} \
99
&& apt clean -y && rm -rf /var/lib/apt/lists/*
1010

11-
ARG JENKINS_UID=1009
12-
ARG JENKINS_GID=1010
13-
RUN groupadd -f -g ${JENKINS_GID} jenkins && ( getent passwd ${JENKINS_UID} || useradd -ms /bin/bash jenkins -u ${JENKINS_UID} -g ${JENKINS_GID} )
14-
15-
# Add github.com as an SSH known host
16-
RUN ssh -o StrictHostKeyChecking=no -T git@github.com; cat ~/.ssh/known_hosts >> /etc/ssh/ssh_known_hosts
17-
1811
USER docker

0 commit comments

Comments
 (0)