31 lines
770 B
Docker
31 lines
770 B
Docker
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)"
|
|
|