Skip to content

Commit

Permalink
fix dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-bcw committed Aug 19, 2024
1 parent 5d0280a commit 2f3cb18
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand Down
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,20 @@ ARG TARGETARCH
ARG BUILDPLATFORM

# Install build dependencies.
RUN dpkg add --add-architecture arm64 && \
RUN dpkg --add-architecture arm64 && \
apt-get update && apt-get install -y \
# for jemalloc
libjemalloc-dev \
libjemalloc2 \
libjemalloc-dev:${TARGETARCH} \
libjemalloc2:${TARGETARCH} \
make \
# for openssl
libssl-dev \
pkg-config \
# for cross compilation
libssl-dev:arm64 \
gcc-aarch64-linux-gnu \
libc6-dev-arm64-cross \
binutils-aarch64-linux-gnu \
&& rustup target add aarch64-unknown-linux-gnu \
# clean the image
&& rm -rf /var/lib/apt/lists/*
Expand All @@ -57,8 +59,9 @@ set -eux
cd /src

TARGET=""
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=""
case ${TARGETARCH} in \
arm64) TARGET="aarch64-unknown-linux-gnu" ;; \
arm64) TARGET="aarch64-unknown-linux-gnu" CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER="/usr/bin/aarch64-linux-gnu-gcc";; \
amd64) TARGET="x86_64-unknown-linux-gnu" ;; \
*) exit 1 ;; \
esac
Expand All @@ -78,7 +81,7 @@ fi
# maxdepth because binaries are in the root
# - other folders contain build scripts etc.
mkdir /output
find "/artifacts/$SUBDIR" \
find "/artifacts/$TARGET/$SUBDIR" \
-maxdepth 1 \
-type f \
-executable \
Expand Down
11 changes: 7 additions & 4 deletions optimized-worker.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,20 @@ ARG TARGETARCH
ARG BUILDPLATFORM

# Install build dependencies.
RUN dpkg add --add-architecture arm64 && \
RUN dpkg --add-architecture arm64 && \
apt-get update && apt-get install -y \
# for jemalloc
libjemalloc-dev \
libjemalloc2 \
libjemalloc-dev:${TARGETARCH} \
libjemalloc2:${TARGETARCH} \
make \
# for openssl
libssl-dev \
pkg-config \
# for cross compilation
libssl-dev:arm64 \
gcc-aarch64-linux-gnu \
libc6-dev-arm64-cross \
binutils-aarch64-linux-gnu \
&& rustup target add aarch64-unknown-linux-gnu \
# clean the image
&& rm -rf /var/lib/apt/lists/*
Expand Down Expand Up @@ -60,8 +62,9 @@ set -eux
cd /src

TARGET=""
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=""
case ${TARGETARCH} in \
arm64) TARGET="aarch64-unknown-linux-gnu" ;; \
arm64) TARGET="aarch64-unknown-linux-gnu" CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER="/usr/bin/aarch64-linux-gnu-gcc" ;; \
amd64) TARGET="x86_64-unknown-linux-gnu" ;; \
*) exit 1 ;; \
esac
Expand Down
14 changes: 8 additions & 6 deletions pgo-worker.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,24 @@ ARG TARGETARCH
ARG BUILDPLATFORM

# Install build dependencies.
RUN dpkg add --add-architecture arm64 && \
RUN dpkg --add-architecture arm64 && \
apt-get update && apt-get install -y \
# for jemalloc
libjemalloc-dev \
libjemalloc2 \
libjemalloc-dev:${TARGETARCH} \
libjemalloc2:${TARGETARCH} \
make \
# for openssl
libssl-dev \
pkg-config \
# for cross compilation
libssl-dev:arm64 \
gcc-aarch64-linux-gnu \
libc6-dev-arm64-cross \
binutils-aarch64-linux-gnu \
python3:${TARGETARCH} \
python3-pip \
&& rustup target add aarch64-unknown-linux-gnu \
# clean the image
python3 python3-pip \
python3:arm64 python3-pip:arm64 \
&& rm -rf /var/lib/apt/lists/*


Expand All @@ -53,7 +55,7 @@ set -eux

TARGET=""
case ${TARGETARCH} in \
arm64) TARGET="aarch64-unknown-linux-gnu" ;; \
arm64) TARGET="aarch64-unknown-linux-gnu" CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER="/usr/bin/aarch64-linux-gnu-gcc" RUSTFLAGS="-l /usr/bin/aarch64-linux-gnu-gcc";; \
amd64) TARGET="x86_64-unknown-linux-gnu" ;; \
*) exit 1 ;; \
esac
Expand Down

0 comments on commit 2f3cb18

Please sign in to comment.