test-env/Dockerfile
dachary 2f17425104 allow override of gid/uid from the build command (#11)
It is useful when running from a development environment with
a setup identical to the CI.

Signed-off-by: Loïc Dachary <loic@dachary.org>

Reviewed-on: gitea/test-env#11
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: dachary <dachary@noreply.gitea.io>
Co-committed-by: dachary <dachary@noreply.gitea.io>
2021-11-29 05:55:33 +08:00

29 lines
934 B
Docker

FROM golang:1.17-buster
ARG GITEA_ID=1000
ARG GITEA_GID=1000
RUN addgroup \
--gid $GITEA_GID \
gitea && \
adduser \
--gecos '' \
--shell /bin/bash \
--uid $GITEA_ID \
--gid $GITEA_GID \
gitea
# upgrade git to v2.33.0
RUN curl -SL https://github.com/git/git/archive/v2.33.0.tar.gz \
| tar -xzv -C /go \
&& apt-get update \
&& apt-get install -y libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev \
&& make -C /go/git-2.33.0 prefix=/usr all \
&& make -C /go/git-2.33.0 prefix=/usr install \
&& rm -rf /go/git-2.33.0 \
# install git-lfs
&& curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash \
&& apt-get install -y git-lfs \
# install golangci-lint
&& export BINARY="golangci-lint" \
&& curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/v1.43.0/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.43.0