Unfortunately, this also breaks go-mod-upgrade with: upgrade failed error=Error running go command to discover modules: exit status 1 stderr=go: loading module retractions for golang.org/x/mod@v0.16.0: version "v0.17.0" invalid: resolves to version v0.17.1-0.20240315155916-aa51b25a4485 (v0.17.0 is not a tag) go: loading module retractions for golang.org/x/sync@v0.6.0: version "v0.7.0" invalid: resolves to version v0.7.1-0.20240304172602-14be23e5b48b (v0.7.0 is not a tag)
32 lines
851 B
Docker
32 lines
851 B
Docker
FROM golang:1.21
|
|
|
|
MAINTAINER Michał Czeraszkiewicz <contact@czerasz.com>
|
|
|
|
# Set the reset cache variable
|
|
# Read more here: http://czerasz.com/2014/11/13/docker-tip-and-tricks/#use-refreshedat-variable-for-better-cache-control
|
|
ENV REFRESHED_AT 2019-02-06
|
|
|
|
RUN apt-get update
|
|
|
|
# Setup User to match Host User
|
|
# Give the nre user superuser permissions
|
|
ARG USER_ID=1000
|
|
ARG GROUP_ID=1000
|
|
ARG USER_NAME=mgmt
|
|
ARG GROUP_NAME=$USER_NAME
|
|
RUN groupadd --gid $GROUP_ID $GROUP_NAME && \
|
|
useradd --create-home --home /home/$USER_NAME --uid ${USER_ID} --gid $GROUP_NAME --groups sudo $USER_NAME && \
|
|
echo "$USER_NAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
|
|
|
# Copy all the files to the working directory
|
|
COPY . /home/$USER_NAME/mgmt
|
|
|
|
# Change working directory
|
|
WORKDIR /home/$USER_NAME/mgmt
|
|
|
|
# Install dependencies
|
|
RUN make deps
|
|
|
|
# Change user
|
|
USER ${USER_NAME}
|