Add dev container config
This commit is contained in:
30
.devcontainer/Dockerfile
Normal file
30
.devcontainer/Dockerfile
Normal file
@ -0,0 +1,30 @@
|
||||
FROM golang:tip-alpine3.22
|
||||
|
||||
ARG PROJECT_NAME=learn
|
||||
ARG USERNAME=vscode
|
||||
ARG USER_ID=1000
|
||||
ARG USER_GID=${USER_ID}
|
||||
|
||||
|
||||
RUN apk update --no-cache && apk add --no-cache \
|
||||
git \
|
||||
curl \
|
||||
wget \
|
||||
unzip \
|
||||
zsh \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& go install github.com/go-delve/delve/cmd/dlv@latest \
|
||||
&& go install -v golang.org/x/tools/gopls@latest \
|
||||
&& addgroup -g ${USER_GID} ${USERNAME} \
|
||||
&& adduser -D -u ${USER_ID} \
|
||||
-G ${USERNAME} \
|
||||
-s /bin/zsh \
|
||||
${USERNAME} \
|
||||
&& mkdir -p /home/$USERNAME/.vscode-server \
|
||||
&& chown -R ${USER_ID}:${USER_ID} /home/${USERNAME}
|
||||
|
||||
USER ${USERNAME}
|
||||
WORKDIR /srv/${PROJECT_NAME}
|
||||
|
||||
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
||||
|
||||
Reference in New Issue
Block a user