aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile.dev
blob: 25de2d2c3d3056aaf65c94a8924f09a57f096141 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM mcr.microsoft.com/devcontainers/rust:2-trixie

## Tooling and configuration
ARG PKGS_TOOLS="llvm sqlite3 sqlite3-tools"
RUN apt-get update \
 && apt-get upgrade -y \
 && apt-get install -y hx starship sudo ${PKGS_TOOLS}

## Code area configuration
ARG WORKING_DIR="/code"
RUN mkdir -p ${WORKING_DIR}

## Container user - will override 'vscode', 'users' defaults
ARG USER=sparrow
ARG USER_UID=1000
ARG USER_GID=1000
ARG USERS_GID=998
RUN groupmod -n ${USER} "$(grep ${USER_GID} /etc/group | cut -d: -f1)" \
 && groupmod --gid ${USERS_GID} users \
 && usermod -l ${USER} -m -d /home/${USER} -Gusers "$(grep ${USER_UID} /etc/passwd | cut -d: -f1)" \
 && chown -R ${USER_UID}:${USER_GID} /home/${USER} \
 && echo "${USER} ALL=\(root\) NOPASSWD:ALL" > /etc/sudoers.d/${USER} \
 && chmod 0440 /etc/sudoers.d/${USER}
RUN echo 'eval "$(starship init zsh)"' >> /home/${USER}/.zshrc \
 && chown ${USER}:${USER} ${WORKING_DIR}

USER ${USER}

RUN mkdir ~/.gnupg \
 && chmod 0700 ~/.gnupg

WORKDIR ${WORKING_DIR}