Skip to content

Commit 36dcbc3

Browse files
committed
go back to 1001
1 parent e287e89 commit 36dcbc3

File tree

4 files changed

+8
-29
lines changed

4 files changed

+8
-29
lines changed

src/base/.devcontainer/Dockerfile

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ LABEL org.opencontainers.image.containerName=${CONTAINER_NAME}
2222
LABEL org.opencontainers.image.authors="NHS England EPS Team"
2323
LABEL org.opencontainers.image.base.image="mcr.microsoft.com/devcontainers/base:ubuntu-22.04"
2424

25-
26-
2725
COPY .tool-versions.asdf ${SCRIPTS_DIR}/${CONTAINER_NAME}/.tool-versions.asdf
2826
COPY --chmod=755 scripts ${SCRIPTS_DIR}/${CONTAINER_NAME}
2927

@@ -40,10 +38,3 @@ RUN ./vscode_install.sh
4038

4139
# Switch back to root to install the devcontainer CLI globally
4240
USER root
43-
44-
RUN cp -R /home/vscode/.asdf /home/githubrunner/ && \
45-
cp /home/vscode/.tool-versions.asdf /home/githubrunner/.tool-versions.asdf && \
46-
cp /home/vscode/.tool-versions /home/githubrunner/.tool-versions && \
47-
cp -R /home/vscode/.config /home/githubrunner/ && \
48-
cp -R /home/vscode/.local /home/githubrunner/ && \
49-
chown -R githubrunner:githubrunner /home/githubrunner/

src/base/.devcontainer/scripts/root_install.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,12 @@ mkdir -p /usr/share/secrets-scanner
6767
chmod 755 /usr/share/secrets-scanner
6868
curl -L https://raw.githubusercontent.com/NHSDigital/software-engineering-quality-framework/main/tools/nhsd-git-secrets/nhsd-rules-deny.txt -o /usr/share/secrets-scanner/nhsd-rules-deny.txt
6969

70-
chown -R vscode:vscode /home/vscode
71-
mkdir -p /work
70+
# fix user and group ids for vscode user to be 1001 so it can be used by github actions
71+
requested_uid=1001
72+
requested_gid=1001
73+
current_uid="$(id -u vscode)"
74+
current_gid="$(id -g vscode)"
75+
if [ "${current_gid}" != "${requested_gid}" ]; then groupmod -g "${requested_gid}" vscode; fi
76+
if [ "${current_uid}" != "${requested_uid}" ]; then usermod -u "${requested_uid}" -g "${requested_gid}" vscode; fi
7277

73-
addgroup githubrunner -gid 1001
74-
adduser githubrunner -uid 1001 -gid 1001 --shell /bin/bash --disabled-password -c "Githubrunner user"
75-
echo "githubrunner ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
78+
chown -R vscode:vscode /home/vscode

src/common/Dockerfile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,8 @@ USER vscode
3535
WORKDIR ${SCRIPTS_DIR}/${CONTAINER_NAME}
3636
COPY .tool-versions /tmp/.tool-versions
3737
RUN cat /tmp/.tool-versions >> /home/vscode/.tool-versions
38-
ENV PATH="/home/vscode/.asdf/shims/:$PATH"
3938

4039
RUN ./vscode_install.sh
4140

4241
# Switch back to root to install the devcontainer CLI globally
4342
USER root
44-
45-
RUN cp -R /home/vscode/.asdf /home/githubrunner/ && \
46-
cp /home/vscode/.tool-versions.asdf /home/githubrunner/.tool-versions.asdf && \
47-
cp /home/vscode/.tool-versions /home/githubrunner/.tool-versions && \
48-
cp -R /home/vscode/.config /home/githubrunner/ && \
49-
cp -R /home/vscode/.local /home/githubrunner/ && \
50-
chown -R githubrunner:githubrunner /home/githubrunner/

src/projects/fhir_facade_api/.devcontainer/Dockerfile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,3 @@ RUN ./vscode_install.sh
3737

3838
# Switch back to root to install the devcontainer CLI globally
3939
USER root
40-
41-
RUN cp -R /home/vscode/.asdf /home/githubrunner/ && \
42-
cp /home/vscode/.tool-versions.asdf /home/githubrunner/.tool-versions.asdf && \
43-
cp /home/vscode/.tool-versions /home/githubrunner/.tool-versions && \
44-
cp -R /home/vscode/.config /home/githubrunner/ && \
45-
cp -R /home/vscode/.local /home/githubrunner/ && \
46-
chown -R githubrunner:githubrunner /home/githubrunner/

0 commit comments

Comments
 (0)