1
- FROM dpokidov/imagemagick:7.1.1-36-bookworm AS build
1
+ FROM dpokidov/imagemagick:7.1.1-36-2- bookworm AS build
2
2
3
3
ARG BRANCH=main
4
4
@@ -18,43 +18,44 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-reco
18
18
# Installing golang
19
19
ENV PATH /usr/local/go/bin:$PATH
20
20
21
- ENV GOLANG_VERSION 1.21.9
21
+ ENV GOLANG_VERSION 1.22.6
22
22
23
23
RUN set -eux; \
24
+ now="$(date '+%s')" ; \
24
25
arch="$(dpkg --print-architecture)" ; arch="${arch##*-}" ; \
25
26
url=; \
26
27
case "$arch" in \
27
28
'amd64' ) \
28
- url='https://dl.google.com/go/go1.21.9 .linux-amd64.tar.gz' ; \
29
- sha256='f76194c2dc607e0df4ed2e7b825b5847cb37e34fc70d780e2f6c7e805634a7ea ' ; \
29
+ url='https://dl.google.com/go/go1.22.6 .linux-amd64.tar.gz' ; \
30
+ sha256='999805bed7d9039ec3da1a53bfbcafc13e367da52aa823cb60b68ba22d44c616 ' ; \
30
31
;; \
31
32
'armhf' ) \
32
- url='https://dl.google.com/go/go1.21.9 .linux-armv6l.tar.gz' ; \
33
- sha256='3d53e0fc659a983bbca3ffa373fab26093d8b1d94198a503be19003a1d73ffb3 ' ; \
33
+ url='https://dl.google.com/go/go1.22.6 .linux-armv6l.tar.gz' ; \
34
+ sha256='b566484fe89a54c525dd1a4cbfec903c1f6e8f0b7b3dbaf94c79bc9145391083 ' ; \
34
35
;; \
35
36
'arm64' ) \
36
- url='https://dl.google.com/go/go1.21.9 .linux-arm64.tar.gz' ; \
37
- sha256='4d169d9cf3dde1692b81c0fd9484fa28d8bc98f672d06bf9db9c75ada73c5fbc ' ; \
37
+ url='https://dl.google.com/go/go1.22.6 .linux-arm64.tar.gz' ; \
38
+ sha256='c15fa895341b8eaf7f219fada25c36a610eb042985dc1a912410c1c90098eaf2 ' ; \
38
39
;; \
39
40
'i386' ) \
40
- url='https://dl.google.com/go/go1.21.9 .linux-386.tar.gz' ; \
41
- sha256='a8ba72a03dd7e6e5b8827754153b0dc335361343535b733d666c458e30996b4a ' ; \
41
+ url='https://dl.google.com/go/go1.22.6 .linux-386.tar.gz' ; \
42
+ sha256='9e680027b058beab10ce5938607660964b6d2c564bf50bdb01aa090dc5beda98 ' ; \
42
43
;; \
43
44
'mips64el' ) \
44
- url='https://dl.google.com/go/go1.21.9 .linux-mips64le.tar.gz' ; \
45
- sha256='10e99c0928698a01231df9a8c57b73376380f253005d95cffb932a47f2052bd9 ' ; \
45
+ url='https://dl.google.com/go/go1.22.6 .linux-mips64le.tar.gz' ; \
46
+ sha256='01547606c5b5c1b0e5587b3afd65172860d2f4755e523785832905759ecce2d7 ' ; \
46
47
;; \
47
48
'ppc64el' ) \
48
- url='https://dl.google.com/go/go1.21.9 .linux-ppc64le.tar.gz' ; \
49
- sha256='6eadde4149c36dae7d9a9bd9385285db1d0e2988350822f4c72a5eb11ffbfffc ' ; \
49
+ url='https://dl.google.com/go/go1.22.6 .linux-ppc64le.tar.gz' ; \
50
+ sha256='9d99fce3f6f72a76630fe91ec0884dfe3db828def4713368424900fa98bb2bd6 ' ; \
50
51
;; \
51
52
'riscv64' ) \
52
- url='https://dl.google.com/go/go1.21.9 .linux-riscv64.tar.gz' ; \
53
- sha256='b92dcc990298d68652e28f3bec57824de99a328b8e584a31490b96fe4bd973c5 ' ; \
53
+ url='https://dl.google.com/go/go1.22.6 .linux-riscv64.tar.gz' ; \
54
+ sha256='30be9c9b9cc4f044d4da9a33ee601ab7b3aff4246107d323a79e08888710754e ' ; \
54
55
;; \
55
56
's390x' ) \
56
- url='https://dl.google.com/go/go1.21.9 .linux-s390x.tar.gz' ; \
57
- sha256='05daee44fc4771b2a2471b678a812de2488f05110976faeb8bbbae740e01e7ae ' ; \
57
+ url='https://dl.google.com/go/go1.22.6 .linux-s390x.tar.gz' ; \
58
+ sha256='82f3bae3ddb4ede45b848db48c5486fadb58551e74507bda45484257e7194a95 ' ; \
58
59
;; \
59
60
*) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)" ; exit 1 ;; \
60
61
esac; \
@@ -79,8 +80,11 @@ RUN set -eux; \
79
80
# save the timestamp from the tarball so we can restore it for reproducibility, if necessary (see below)
80
81
SOURCE_DATE_EPOCH="$(stat -c '%Y' /usr/local/go)" ; \
81
82
export SOURCE_DATE_EPOCH; \
83
+ touchy="$(date -d " @$SOURCE_DATE_EPOCH" '+%Y%m%d%H%M.%S')" ; \
82
84
# for logging validation/edification
83
85
date --date "@$SOURCE_DATE_EPOCH" --rfc-2822; \
86
+ # sanity check (detected value should be older than our wall clock)
87
+ [ "$SOURCE_DATE_EPOCH" -lt "$now" ]; \
84
88
\
85
89
if [ "$arch" = 'armhf' ]; then \
86
90
[ -s /usr/local/go/go.env ]; \
@@ -92,10 +96,15 @@ RUN set -eux; \
92
96
} >> /usr/local/go/go.env; \
93
97
after="$(go env GOARM)" ; [ "$after" = '7' ]; \
94
98
# (re-)clamp timestamp for reproducibility (allows "COPY --link" to be more clever/useful)
95
- date="$(date -d " @$SOURCE_DATE_EPOCH" '+%Y%m%d%H%M.%S')" ; \
96
- touch -t "$date" /usr/local/go/go.env /usr/local/go; \
99
+ touch -t "$touchy" /usr/local/go/go.env /usr/local/go; \
97
100
fi; \
98
101
\
102
+ # ideally at this point, we would just "COPY --link ... /usr/local/go/ /usr/local/go/" but BuildKit insists on creating the parent directories (perhaps related to https://github.com/opencontainers/image-spec/pull/970), and does so with unreproducible timestamps, so we instead create a whole new "directory tree" that we can "COPY --link" to accomplish what we want
103
+ mkdir /target /target/usr /target/usr/local; \
104
+ mv -vT /usr/local/go /target/usr/local/go; \
105
+ ln -svfT /target/usr/local/go /usr/local/go; \
106
+ touch -t "$touchy" /target/usr/local /target/usr /target; \
107
+ \
99
108
# smoke test
100
109
go version; \
101
110
# make sure our reproducibile timestamp is probably still correct (best-effort inline reproducibility test)
@@ -120,7 +129,7 @@ WORKDIR /go/src/github.com/Pixboost/transformimgs/cmd
120
129
121
130
RUN go build -o /transformimgs
122
131
123
- FROM dpokidov/imagemagick:7.1.1-36-bookworm
132
+ FROM dpokidov/imagemagick:7.1.1-36-2- bookworm
124
133
125
134
ENV IM_HOME /usr/local/bin
126
135
0 commit comments