Skip to content

Commit

Permalink
fix dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
yito88 committed Nov 27, 2024
1 parent 8a1ce8f commit 44dcf32
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions ci/release/hermes.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,23 @@
FROM rust:1-buster AS build-env

ARG TAG
ARG PROTOC_VERSION=28.3

WORKDIR /root

# Install protoc
RUN ARCH=$(uname -m) && \
if [ "$ARCH" = "x86_64" ]; then \
ARCH=x86_64; \
elif [ "$ARCH" = "aarch64" ]; then \
ARCH=aarch_64;\
else \
echo "Unsupported architecture: $ARCH"; exit 1; \
fi && \
wget https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-$ARCH.zip -O /tmp/protoc.zip && \
unzip /tmp/protoc.zip -d /usr/local && \
rm -rf /tmp/protoc.zip

COPY . .
RUN cargo build --release

Expand All @@ -17,12 +31,24 @@ LABEL maintainer="[email protected]"
ARG UID=2000
ARG GID=2000

RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates wget
RUN update-ca-certificates
RUN groupadd -g ${GID} hermes && useradd -l -m hermes -s /bin/bash -u ${UID} -g ${GID}

WORKDIR /home/hermes

RUN ARCH=$(uname -m) && \
if [ "$ARCH" = "x86_64" ]; then \
DEB_URL=http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb; \
elif [ "$ARCH" = "aarch64" ]; then \
DEB_URL=http://ports.ubuntu.com/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_arm64.deb; \
else \
echo "Unsupported architecture: $ARCH"; exit 1; \
fi && \
wget $DEB_URL -O /tmp/libssl1.1.deb && \
dpkg -i /tmp/libssl1.1.deb && \
rm -rf /tmp/libssl1.1.deb

USER hermes:hermes
ENTRYPOINT ["/usr/bin/hermes"]

COPY --chown=hermes:hermes --from=build-env /root/target/release/hermes /usr/bin/hermes

0 comments on commit 44dcf32

Please sign in to comment.