Skip to content

Commit 97fc75c

Browse files
committed
Add defaults to arguments of container image Dockerfile
Signed-off-by: Doru Blânzeanu <[email protected]>
1 parent 150821a commit 97fc75c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.devcontainer/Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
FROM mcr.microsoft.com/devcontainers/base:debian AS base
44

5-
ARG USER
6-
ARG GROUP
7-
ARG RUST_TOOLCHAIN
5+
ARG USER=vscode
6+
ARG GROUP=vscode
7+
ARG RUST_TOOLCHAIN=1.81.0
88

99
ENV HOME="/home/${USER}"
1010
ENV PATH="$HOME/.cargo/bin:$PATH"
@@ -37,21 +37,21 @@ RUN wget https://apt.llvm.org/llvm.sh \
3737
FROM base AS dev
3838

3939
# Make sure the devcontainer user has sudo access
40-
RUN chown -R "${USER}:$GROUP" /home/${USER} \
40+
RUN chown -R "${USER}:${GROUP}" /home/${USER} \
4141
&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
4242

4343
# Persist bash hystory
4444
RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \
4545
&& mkdir /commandhistory \
4646
&& touch /commandhistory/.bash_history \
47-
&& chown -R $USER /commandhistory \
48-
&& echo "$SNIPPET" >> "/home/$USER/.bashrc"
47+
&& chown -R "${USER}" /commandhistory \
48+
&& echo "$SNIPPET" >> "/home/${USER}/.bashrc"
4949

5050
USER $USER
5151

5252
# Install rust
5353
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
54-
&& rustup default $RUST_TOOLCHAIN \
54+
&& rustup default ${RUST_TOOLCHAIN} \
5555
&& rustup target add x86_64-unknown-linux-gnu \
5656
&& rustup target add x86_64-unknown-none \
5757
&& rustup target add x86_64-pc-windows-msvc \

0 commit comments

Comments
 (0)