wispem-wantex e6a8175644
Some checks failed
CI / build-docker (push) Successful in 47s
CI / build-docker-bootstrap (push) Has been skipped
CI / release-test (push) Failing after 4s
generator: use 'Must' flow helper in generated query funcs
2026-01-10 15:28:09 -08:00

26 lines
944 B
Docker

# A dev container.
FROM alpine:3.22
RUN apk add build-base git go sqlite vim 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.
#
# If the host user is `root` (uid = 0), we skip creating a new user, because it will fail otherwise.
ARG USERNAME
ARG UID
ARG GID
RUN if [ "${UID}" -ne 0 ]; then \
addgroup -g "${GID}" "${USERNAME}" && \
adduser -D -u "${UID}" -G "${USERNAME}" "${USERNAME}" && \
echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/"${USERNAME}"; \
fi
USER ${USERNAME}