|
1 | 1 | FROM mcr.microsoft.com/devcontainers/base:ubuntu |
2 | 2 |
|
3 | | - |
| 3 | +# provide DOCKER_GID via build args if you need to force group id to match host |
| 4 | +ARG DOCKER_GID |
4 | 5 | ARG TARGETARCH |
5 | 6 | ENV TARGETARCH=${TARGETARCH} |
6 | 7 |
|
7 | 8 | ARG ASDF_VERSION |
8 | 9 | COPY .tool-versions.asdf /tmp/.tool-versions.asdf |
9 | 10 |
|
| 11 | +# specify DOCKER_GID to force container docker group id to match host |
| 12 | +RUN if [ -n "${DOCKER_GID}" ]; then \ |
| 13 | + if ! getent group docker; then \ |
| 14 | + groupadd -g ${DOCKER_GID} docker; \ |
| 15 | + else \ |
| 16 | + groupmod -g ${DOCKER_GID} docker; \ |
| 17 | + fi && \ |
| 18 | + usermod -aG docker vscode; \ |
| 19 | + fi |
| 20 | + |
| 21 | +# Anticipate and resolve potential permission issues with apt |
| 22 | +RUN mkdir -p /tmp && chmod 1777 /tmp |
| 23 | + |
10 | 24 | RUN apt-get update \ |
11 | 25 | && export DEBIAN_FRONTEND=noninteractive \ |
12 | 26 | && apt-get -y dist-upgrade \ |
@@ -53,16 +67,16 @@ USER vscode |
53 | 67 | ENV PATH="$PATH:/home/vscode/.asdf/shims/:/workspaces/eps-prescription-tracker-ui/node_modules/.bin:/workspaces/eps-workflow-quality-checks/.venv/bin" |
54 | 68 |
|
55 | 69 | # Install ASDF plugins# |
56 | | -RUN asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git; \ |
57 | | - asdf plugin add actionlint; \ |
58 | | - asdf plugin add shellcheck https://github.com/luizm/asdf-shellcheck.git; \ |
59 | | - asdf plugin add poetry https://github.com/asdf-community/asdf-poetry.git; \ |
| 70 | +RUN asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git && \ |
| 71 | + asdf plugin add actionlint && \ |
| 72 | + asdf plugin add shellcheck https://github.com/luizm/asdf-shellcheck.git && \ |
| 73 | + asdf plugin add poetry https://github.com/asdf-community/asdf-poetry.git && \ |
60 | 74 | asdf plugin add python |
61 | 75 |
|
62 | 76 | WORKDIR /workspaces/eps-workflow-quality-checks |
63 | 77 |
|
64 | 78 | ADD .tool-versions /workspaces/eps-workflow-quality-checks/.tool-versions |
65 | 79 | ADD .tool-versions /home/vscode/.tool-versions |
66 | 80 |
|
67 | | -RUN asdf install python; \ |
68 | | - asdf install; |
| 81 | +RUN asdf install python && \ |
| 82 | + asdf install |
0 commit comments