-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
87 lines (77 loc) · 3.24 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Copyright 2020 Adam Chalkley
#
# https://github.com/atc0005/go-ci
#
# Licensed under the MIT License. See LICENSE file in the project root for
# full license information.
# https://hub.docker.com/_/golang
FROM i386/golang:1.20.4-alpine3.16
# https://docs.github.com/en/packages/learn-github-packages/connecting-a-repository-to-a-package
LABEL org.opencontainers.image.source="https://github.com/atc0005/go-ci"
# https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys
LABEL org.opencontainers.image.documentation="https://github.com/atc0005/go-ci"
LABEL org.opencontainers.image.url="https://github.com/atc0005/go-ci"
LABEL org.opencontainers.image.title="go-ci-stable-alpine-buildx86"
LABEL org.opencontainers.image.description="Docker container image used to build dev and stable \
releases of Go code. Based on the latest version of the current stable i386/golang alpine \
image. Supports cross-platform, static cgo-enabled builds for Windows and Linux."
LABEL org.opencontainers.image.authors="Adam Chalkley (github.com/atc0005)"
# NOTE: This version was different than the base `gcc` pkg when last checked
ENV APK_GCC_MINGW64_VERSION="11.3.0-r0"
ENV APK_BASH_VERSION="5.1.16-r2"
ENV APK_GCC_VERSION="11.2.1_git20220219-r2"
ENV APK_GIT_VERSION="2.36.6-r0"
ENV APK_MAKE_VERSION="4.3-r0"
ENV APK_UTIL_LINUX_VERSION="2.38-r1"
ENV APK_FILE_VERSION="5.41-r0"
ENV APK_NANO_VERSION="6.3-r0"
ENV APK_MUSL_DEV_VERSION="1.2.3-r3"
ENV APK_XZ_VERSION="5.2.5-r1"
# https://github.com/tc-hib/go-winres/releases
ENV GO_WINRES_VERSION="v0.3.1"
# https://github.com/goreleaser/nfpm/releases
ENV NFPM_VERSION="v2.30.1"
# https://github.com/choffmeister/git-describe-semver/releases
ENV GIT_DESCRIBE_SEMVER_VERSION="v0.3.11"
# Install specific version of packages
# RUN apk update && \
# apk add --no-cache \
RUN apk add --no-cache \
#
# used for builds
make="${APK_MAKE_VERSION}" \
#
# used by some Makefiles
bash="${APK_BASH_VERSION}" \
#
# provides `column` binary, which is used by some Makefiles
util-linux="${APK_UTIL_LINUX_VERSION}" \
#
# used by go get, other tooling
git="${APK_GIT_VERSION}" \
#
# used for static compilation
gcc="${APK_GCC_VERSION}" \
#
# used for static compilation
musl-dev="${APK_MUSL_DEV_VERSION}" \
#
# used for cross-platform compiling (e.g., Windows and Linux)
mingw-w64-gcc="${APK_GCC_MINGW64_VERSION}" \
#
# not strictly required, useful if we need to directly examine files
nano="${APK_NANO_VERSION}" \
# intended to help quickly determine whether a binary is statically or
# dynamically linked
file="${APK_FILE_VERSION}" \
xz="${APK_XZ_VERSION}" \
\
&& echo "Installing go-winres@${GO_WINRES_VERSION}" \
&& go install github.com/tc-hib/go-winres@${GO_WINRES_VERSION} \
&& go version -m $(which go-winres) | awk '$1 == "mod" { print $3 }' \
&& echo "Installing nfpm@${NFPM_VERSION}" \
&& go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${NFPM_VERSION} \
&& nfpm --version \
&& go install github.com/choffmeister/git-describe-semver@${GIT_DESCRIBE_SEMVER_VERSION} \
&& go version -m $(which git-describe-semver) | awk '$1 == "mod" { print $3 }' \
&& go clean -cache -modcache