Skip to content

Commit 66a2728

Browse files
committed
refactor: image dependencies as arguments
1 parent 6d60c41 commit 66a2728

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

docker/tmpl.Dockerfile

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,21 @@ LABEL maintainer="Jose Quintana <git.io/joseluisq>"
88
# The Rust toolchain to use when building our image. Set by `hooks/build`.
99
ARG TOOLCHAIN=stable
1010

11+
12+
# Dependencies
13+
1114
# OpenSSL v1.1.1
12-
# File: openssl-1.1.1g.tar.gz (2020-Apr-21 13:01:56)
13-
ARG OPENSSL_VERSION=1.1.1
15+
ARG OPENSSL_VERSION=1.1.1g
16+
17+
# zlib - http://zlib.net/
18+
ARG ZLIB_VERSION=1.2.11
19+
20+
# libpq - https://ftp.postgresql.org/pub/source/
21+
ARG POSTGRESQL_VERSION=11.7
22+
23+
# Mac OS X SDK version for OS X Cross
24+
ARG MACOSX_SDK_VERSION=10.11
25+
1426

1527
# Make sure we have basic dev tools for building C libraries. Our goal
1628
# here is to support the musl-libc builds and Cargo builds needed for a
@@ -94,8 +106,9 @@ RUN set -eux \
94106
&& ln -s /usr/include/x86_64-linux-gnu/asm /usr/local/musl/include/asm \
95107
&& ln -s /usr/include/asm-generic /usr/local/musl/include/asm-generic \
96108
&& cd /tmp \
97-
&& curl -LO "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}g.tar.gz" \
98-
&& tar xvzf "openssl-${OPENSSL_VERSION}g.tar.gz" && cd "openssl-${OPENSSL_VERSION}g" \
109+
&& curl -LO "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz" \
110+
&& tar xvzf "openssl-$OPENSSL_VERSION.tar.gz" \
111+
&& cd "openssl-$OPENSSL_VERSION" \
99112
&& env CC=musl-gcc ./Configure no-shared no-zlib -fPIC --prefix=/usr/local/musl -DOPENSSL_NO_SECURE_MEMORY linux-x86_64 \
100113
&& env C_INCLUDE_PATH=/usr/local/musl/include/ make depend \
101114
&& env C_INCLUDE_PATH=/usr/local/musl/include/ make \
@@ -108,7 +121,6 @@ RUN set -eux \
108121
RUN set -eux \
109122
&& echo "Building zlib..." \
110123
&& cd /tmp \
111-
&& env ZLIB_VERSION=1.2.11 \
112124
&& curl -LO "http://zlib.net/zlib-$ZLIB_VERSION.tar.gz" \
113125
&& tar xzf "zlib-$ZLIB_VERSION.tar.gz" \
114126
&& cd "zlib-$ZLIB_VERSION" \
@@ -121,7 +133,6 @@ RUN set -eux \
121133
RUN set -eux \
122134
&& echo "Building libpq..." \
123135
&& cd /tmp \
124-
&& env POSTGRESQL_VERSION=11.2 \
125136
&& curl -LO "https://ftp.postgresql.org/pub/source/v$POSTGRESQL_VERSION/postgresql-$POSTGRESQL_VERSION.tar.gz" \
126137
&& tar xzf "postgresql-$POSTGRESQL_VERSION.tar.gz" \
127138
&& cd "postgresql-$POSTGRESQL_VERSION" \
@@ -155,15 +166,13 @@ ENV OPENSSL_DIR=/usr/local/musl/ \
155166
# Install OS X Cross
156167
# A Mac OS X cross toolchain for Linux, FreeBSD, OpenBSD and Android
157168

158-
ENV MACOSX_SDK_VERSION 10.11
159-
160169
RUN set -eux \
161170
&& echo "Building osxcross..." \
162171
&& cd /usr/local/ \
163172
&& git clone --depth 1 https://github.com/tpoechtrager/osxcross \
164173
&& cd osxcross \
165-
&& curl -L -o ./tarballs/MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz \
166-
https://s3.amazonaws.com/andrew-osx-sdks/MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz \
174+
&& curl -L -o "./tarballs/MacOSX$MACOSX_SDK_VERSION.sdk.tar.xz" \
175+
"https://s3.amazonaws.com/andrew-osx-sdks/MacOSX$MACOSX_SDK_VERSION.sdk.tar.xz" \
167176
&& env UNATTENDED=yes OSX_VERSION_MIN=10.7 ./build.sh \
168177
&& rm -rf *~ taballs *.tar.xz \
169178
&& rm -rf /tmp/* \

0 commit comments

Comments
 (0)