Skip to content

Commit

Permalink
Use base tag
Browse files Browse the repository at this point in the history
  • Loading branch information
ianks committed Jan 3, 2024
1 parent b217d57 commit 6cdd5de
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 33 deletions.
56 changes: 28 additions & 28 deletions docker/builds/x86_64-linux-musl/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG BASE_IMAGE_TAG
ARG RUST_TARGET

FROM ghcr.io/cross-rs/$RUST_TARGET:$BASE_IMAGE_TAG as base
FROM ghcr.io/cross-rs/$RUST_TARGET@sha256:c7bd1cd7124507faa1f320c8f959046424494f888cef45183a122e9dc8252ee4 as base

ARG RUBY_VERSION
ARG RUBY_MINOR
Expand All @@ -13,12 +13,12 @@ ARG RUST_TARGET
ARG FORCE_DISABLE_XRUBIES_PKG_CHECK=false

ENV RUBY_TARGET="$RUBY_TARGET" \
RUST_TARGET="$RUST_TARGET" \
RUBY_SHIM_RUNNER="$CROSS_TARGET_RUNNER" \
TARGET_DEB_ARCH="amd64" \
XRUBIES_CROSS_TARGET="x86_64-linux-musl" \
XRUBIES_PKG_ROOT="/tmp/pkg" \
FORCE_DISABLE_XRUBIES_PKG_CHECK="$FORCE_DISABLE_XRUBIES_PKG_CHECK"
RUST_TARGET="$RUST_TARGET" \
RUBY_SHIM_RUNNER="$CROSS_TARGET_RUNNER" \
TARGET_DEB_ARCH="amd64" \
XRUBIES_CROSS_TARGET="x86_64-linux-musl" \
XRUBIES_PKG_ROOT="/tmp/pkg" \
FORCE_DISABLE_XRUBIES_PKG_CHECK="$FORCE_DISABLE_XRUBIES_PKG_CHECK"

COPY docker/scripts/helpers.sh /
COPY docker/pkg/ /opt/_internal/pkg/
Expand All @@ -28,24 +28,24 @@ FROM base as builder
COPY docker/scripts/build-ruby.sh /

RUN set -ex; \
/opt/_internal/pkg/install --install-dir /usr/local --cross-target native \
libclang \
patchelf; \
/opt/_internal/pkg/install \
zlib \
yaml \
readline \
libffi \
openssl; \
export PKG_CONFIG_PATH="$XRUBIES_PKG_ROOT/lib/pkgconfig"; \
/build-ruby.sh "$RUBY_VERSION" "$RUBY_MINOR" "$RUBY_SHA256" \
--with-openssl-dir="$XRUBIES_PKG_ROOT" \
--with-zlib-dir="$XRUBIES_PKG_ROOT" \
--with-libyaml-dir="$XRUBIES_PKG_ROOT" \
--with-libffi-dir="$XRUBIES_PKG_ROOT" \
--with-readline-dir="$XRUBIES_PKG_ROOT" \
--enable-static; \
rm -rf /opt/_internal/pkg /tmp /usr/local/bin/patchelf;
/opt/_internal/pkg/install --install-dir /usr/local --cross-target native \
libclang \
patchelf; \
/opt/_internal/pkg/install \
zlib \
yaml \
readline \
libffi \
openssl; \
export PKG_CONFIG_PATH="$XRUBIES_PKG_ROOT/lib/pkgconfig"; \
/build-ruby.sh "$RUBY_VERSION" "$RUBY_MINOR" "$RUBY_SHA256" \
--with-openssl-dir="$XRUBIES_PKG_ROOT" \
--with-zlib-dir="$XRUBIES_PKG_ROOT" \
--with-libyaml-dir="$XRUBIES_PKG_ROOT" \
--with-libffi-dir="$XRUBIES_PKG_ROOT" \
--with-readline-dir="$XRUBIES_PKG_ROOT" \
--enable-static; \
rm -rf /opt/_internal/pkg /tmp /usr/local/bin/patchelf;

FROM base

Expand All @@ -57,9 +57,9 @@ COPY --from=builder /opt/xrubies /opt/xrubies
ENV RUBY_ROOT "/opt/xrubies/$RUBY_MINOR"
ENV GEM_HOME "$RUBY_ROOT/bundle"
ENV PATH="$GEM_HOME/bin:$RUBY_ROOT/bin:$PATH" \
BUNDLE_SILENCE_ROOT_WARNING=1 \
BUNDLE_APP_CONFIG="$GEM_HOME" \
RUBY_VERSION="$RUBY_VERSION"
BUNDLE_SILENCE_ROOT_WARNING=1 \
BUNDLE_APP_CONFIG="$GEM_HOME" \
RUBY_VERSION="$RUBY_VERSION"

# adjust permissions of a few directories for running "gem install" as an arbitrary user
RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME"
Expand Down
13 changes: 8 additions & 5 deletions matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,42 @@ ruby-platform:
dir: docker/builds/x86_64-linux
images:
- slug: "ubuntu"
tag: "0.2.5"
tag: "edge"
docker-platforms: ["linux/amd64"]
- slug: "centos"
tag: "edge-centos"
docker-platforms: ["linux/amd64"]

- slug: "x86_64-linux-musl"
rust-target: "x86_64-unknown-linux-musl"
dir: docker/builds/x86_64-linux-musl
images:
- slug: "ubuntu"
tag: "0.2.5"
tag: "edge"
docker-platforms: ["linux/amd64"]

- slug: "aarch64-linux"
rust-target: "aarch64-unknown-linux-gnu"
dir: docker/builds/aarch64-linux
images:
- slug: "ubuntu"
tag: "0.2.5"
tag: "edge"
docker-platforms: ["linux/amd64"]

- slug: "aarch64-linux-musl"
rust-target: "aarch64-unknown-linux-musl"
dir: docker/builds/aarch64-linux-musl
images:
- slug: "ubuntu"
tag: "0.2.5"
tag: "edge"
docker-platforms: ["linux/amd64"]

- slug: "arm-linux"
rust-target: "arm-unknown-linux-gnueabihf"
dir: docker/builds/arm-linux
images:
- slug: "ubuntu"
tag: "0.2.5"
tag: "edge"
docker-platforms: ["linux/amd64"]

ruby-version:
Expand Down

0 comments on commit 6cdd5de

Please sign in to comment.