@@ -17,7 +17,7 @@ SHELL ["/bin/bash", "-eux", "-o", "pipefail", "-c"]
17
17
# - file - needed by rustup.sh install
18
18
# - automake autoconf libtool - support crates building C deps as part cargo build
19
19
# NB: does not include cmake atm
20
- RUN <<HEREDOC
20
+ RUN <<EOF
21
21
apt-get update
22
22
apt-get install --no-install-recommends -y \
23
23
musl-dev \
@@ -38,11 +38,11 @@ RUN <<HEREDOC
38
38
unzip
39
39
40
40
rm -rf /var/lib/apt/lists/*
41
- HEREDOC
41
+ EOF
42
42
43
43
# Install a more recent release of protoc:
44
44
ARG PROTOBUF_VER="31.0"
45
- RUN <<HEREDOC
45
+ RUN <<EOF
46
46
if [[ ${DOCKER_TARGET_ARCH} == 'aarch64' ]]; then
47
47
DOCKER_TARGET_ARCH=aarch_64
48
48
fi
@@ -52,15 +52,15 @@ RUN <<HEREDOC
52
52
53
53
unzip -j -d /usr/local/bin protoc.zip bin/protoc
54
54
rm -rf protoc.zip
55
- HEREDOC
55
+ EOF
56
56
57
57
# Install prebuilt sccache based on platform:
58
58
ARG SCCACHE_VER="0.10.0"
59
- RUN <<HEREDOC
59
+ RUN <<EOF
60
60
ASSET_NAME="sccache-v${SCCACHE_VER}-${DOCKER_TARGET_ARCH}-unknown-linux-musl"
61
61
curl -fsSL "https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VER}/${ASSET_NAME}.tar.gz" \
62
62
| tar -xz -C /usr/local/bin --strip-components=1 --no-same-owner "${ASSET_NAME}/sccache"
63
- HEREDOC
63
+ EOF
64
64
65
65
# Convenience list of variables for later compilation stages.
66
66
# This helps continuing manually if anything breaks.
@@ -72,7 +72,7 @@ ENV CC=musl-gcc \
72
72
FROM base AS build-zlib
73
73
ARG ZLIB_VER="1.3.1"
74
74
WORKDIR /src/zlib
75
- RUN <<HEREDOC
75
+ RUN <<EOF
76
76
curl -fsSL "https://zlib.net/zlib-${ZLIB_VER}.tar.gz" | tar -xz --strip-components=1
77
77
78
78
export CC="musl-gcc -fPIC -pie"
@@ -81,21 +81,21 @@ RUN <<HEREDOC
81
81
82
82
./configure --static --prefix="${PREFIX}"
83
83
make -j$(nproc) && make install
84
- HEREDOC
84
+ EOF
85
85
86
86
# Build libsqlite3 using same configuration as the alpine linux main/sqlite package
87
87
FROM base AS build-sqlite
88
88
ARG SQLITE_VER="3490200"
89
89
WORKDIR /src/sqlite
90
- RUN <<HEREDOC
90
+ RUN <<EOF
91
91
curl -fsSL "https://www.sqlite.org/2025/sqlite-autoconf-${SQLITE_VER}.tar.gz" | tar -xz --strip-components=1
92
92
93
93
export CC="musl-gcc -fPIC -pie"
94
94
export CFLAGS="-DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_SECURE_DELETE -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_ENABLE_RTREE -DSQLITE_USE_URI -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1"
95
95
96
96
./configure --prefix="${PREFIX}" --host=x86_64-unknown-linux-musl --enable-threadsafe --disable-shared
97
97
make && make install
98
- HEREDOC
98
+ EOF
99
99
100
100
# Install rust using rustup
101
101
FROM base AS install-rustup
@@ -108,7 +108,7 @@ ARG RUSTUP_VER="1.28.2"
108
108
# Uses `--no-modify-path` as `PATH` is set explicitly
109
109
ENV RUSTUP_HOME=/opt/rustup
110
110
ENV CARGO_HOME=/opt/cargo
111
- RUN <<HEREDOC
111
+ RUN <<EOF
112
112
RUST_ARCH="${DOCKER_TARGET_ARCH}-unknown-linux-gnu"
113
113
curl -fsSL -o rustup-init "https://static.rust-lang.org/rustup/archive/${RUSTUP_VER}/${RUST_ARCH}/rustup-init"
114
114
chmod +x rustup-init
@@ -121,7 +121,7 @@ RUN <<HEREDOC
121
121
--target "${DOCKER_TARGET_ARCH}-unknown-linux-musl"
122
122
123
123
rm rustup-init
124
- HEREDOC
124
+ EOF
125
125
126
126
FROM base AS release
127
127
COPY --link --from=install-rustup /opt /opt
@@ -154,7 +154,6 @@ ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C link-self-contained=ye
154
154
WORKDIR /volume
155
155
156
156
LABEL org.opencontainers.image.authors="Eirik Albrigtsen <sszynrae@gmail.com>"
157
- # LABEL org.opencontainers.image.create="$(date --utc --iso-8601=seconds)"
158
157
LABEL org.opencontainers.image.documentation="https://github.com/clux/muslrust"
159
158
LABEL org.opencontainers.image.licenses="MIT"
160
159
LABEL org.opencontainers.image.url="https://github.com/clux/muslrust"
0 commit comments