This repository has been archived by the owner on Nov 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile
72 lines (52 loc) · 1.45 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
ARG IMAGE=renovate/buildpack
FROM ${IMAGE} as build
RUN touch /.dummy
COPY --chown=1000:0 test test
WORKDIR /test
#--------------------------------------
# test: golang
#--------------------------------------
FROM build as testa
# renovate: datasource=docker versioning=docker
RUN install-tool golang 1.19.3
USER 1000
RUN set -ex; cd a; go get -d ./...; cat go.sum; go mod tidy; cat go.sum
RUN set -ex; cd b; cat go.sum; go mod tidy; cat go.sum
RUN set -ex; \
git clone --depth=1 https://github.com/renovate-tests/gomod1; \
cd gomod1; \
go get -d ./...; \
git status -s; \
git checkout -f; \
git clean -fdx; \
go mod tidy; \
git status -s;
USER root
RUN echo export "GOPATH=/home/${USER_NAME}/.go" | tee -a $BASH_ENV
USER 1000
RUN go env
RUN set -ex; cd c; go get -d ./...; cat go.sum
#--------------------------------------
# test: check first patch version eg v1.11.0
#--------------------------------------
FROM build as testb
# do not update patch version
RUN install-tool golang 1.11.0
RUN set -ex; \
git clone --depth=1 https://github.com/renovate-tests/gomod1; \
cd gomod1; \
go get -d ./...; \
git status -s; \
git checkout -f; \
git clean -fdx; \
go mod tidy; \
git status -s;
USER 1000
SHELL [ "/bin/sh", "-c" ]
RUN go env
#--------------------------------------
# final
#--------------------------------------
FROM build
COPY --from=testa /.dummy /.dummy
COPY --from=testb /.dummy /.dummy