-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
71 lines (64 loc) · 2.07 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
ARG DEBIAN_FRONTEND=noninteractive
ARG APT_MIRROR
ARG OSXCROSS_VERSION
FROM ghcr.io/goreleaser/goreleaser-osxcross:$OSXCROSS_VERSION AS osxcross
FROM debian:bullseye AS base
ARG TARGETARCH
ARG DPKG_ARCH
ARG CROSSBUILD_ARCH
ARG OSXCROSS_PATH=/osxcross
ARG MINGW_VERSION=20230130
ARG MINGW_HOST="ubuntu-18.04"
LABEL maintainer="Artur Troian <troian dot ap at gmail dot com>"
LABEL "org.opencontainers.image.source"="https://github.com/goreleaser/goreleaser-cross-toolchains"
# Install deps
SHELL ["/bin/bash", "-c"]
RUN \
set -x; \
echo "Starting image build for Debian" \
&& apt-get update \
&& apt-get install --no-install-recommends -y -q \
make \
git-core \
wget \
xz-utils \
cmake \
openssl \
autoconf \
automake \
bc \
python \
jq \
binfmt-support \
binutils-multiarch \
build-essential \
devscripts \
libtool \
llvm \
multistrap \
patch \
mercurial \
musl-tools \
&& while read arch; do dpkg --add-architecture $arch; done < <(echo "${DPKG_ARCH}" | tr ' ' '\n') \
&& crossbuild_pkgs=$(while read arch; do echo -n "crossbuild-essential-$arch "; done < <(echo "${CROSSBUILD_ARCH}" | tr ' ' '\n')) \
&& apt-get update \
&& apt-get install --no-install-recommends -y -q \
clang \
gcc \
g++ \
libarchive-tools \
gdb \
mingw-w64 \
${crossbuild_pkgs}\
&& apt -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
/tmp/* \
/var/tmp/* \
&& rm -rf /usr/share/man/* \
/usr/share/doc \
&& MINGW_ARCH=$(echo -n $TARGETARCH | sed -e 's/arm64/aarch64/g' | sed -e 's/amd64/x86_64/g') \
&& wget -qO - "https://github.com/mstorsjo/llvm-mingw/releases/download/${MINGW_VERSION}/llvm-mingw-${MINGW_VERSION}-ucrt-${MINGW_HOST}-${MINGW_ARCH}.tar.xz" | bsdtar -xf - \
&& ln -snf $(pwd)/llvm-mingw-${MINGW_VERSION}-ucrt-${MINGW_HOST}-${MINGW_ARCH} /llvm-mingw
COPY --from=osxcross "${OSXCROSS_PATH}" "${OSXCROSS_PATH}"
ENV PATH=${OSX_CROSS_PATH}/bin:$PATH