wispem-wantex e0e6046afe
Some checks failed
CI / build-docker (push) Failing after 0s
CI / build-docker-bootstrap (push) Failing after 1m40s
CI / release-test (push) Has been skipped
devcontainer: add doc, user to match host machine, and scripts to build/start
2026-01-10 13:39:41 -08:00

22 lines
771 B
Docker

# A dev container.
FROM alpine:3.22
RUN apk add build-base git go sqlite shellcheck curl jq sudo bash docker
# Busybox `less` doesn't appear to support colors (makes git diff lose color)
RUN apk add less
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/local/bin v2.0.2
RUN GOBIN=/usr/local/bin go install git.offline-twitter.com/offline-labs/gocheckout@v0.0.2
# Create a user in the container with the same UID as on the host machine, to avoid ownership conflicts.
# The user gets sudo of course.
ARG USERNAME
ARG UID
ARG GID
RUN addgroup -g ${GID} ${USERNAME}
RUN adduser -D -u ${UID} -G ${USERNAME} ${USERNAME}
RUN echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${USERNAME}
USER ${USERNAME}