From 81ed055c000d3e45ed8998dea94a57e919ed89a7 Mon Sep 17 00:00:00 2001 From: Vitor Lima Date: Wed, 19 Jun 2024 18:37:54 -0300 Subject: [PATCH] chore: Update Dockerfile to install cross and set up build environment --- Dockerfile | 6 +++--- dockerhub.sh | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 910f149..2fee603 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,10 +17,10 @@ RUN /bin/bash -c 'if [ -z "$CARGO_SERVER_SSL_CA" ]; then echo "Error: CARGO_SERV # Install dependencies RUN apt update -RUN apt install -y protobuf-compiler libssl-dev gcc pkg-config build-essential cmake clang +RUN apt install -y protobuf-compiler libssl-dev gcc pkg-config build-essential g++-aarch64-linux-gnu libc6-dev-arm64-cross # Install cross -RUN cargo install cross +RUN rustup target add aarch64-unknown-linux-gnu # Set up the build environment RUN mkdir -p ${TAGOIO_SOURCE_FOLDER} @@ -30,7 +30,7 @@ ADD . ${TAGOIO_SOURCE_FOLDER} RUN touch .env # Build the project -RUN cross build --release +RUN cargo build --release # Unset the SSL environment variables RUN unset CARGO_SERVER_SSL_CA CARGO_SERVER_SSL_CERT CARGO_SERVER_SSL_KEY diff --git a/dockerhub.sh b/dockerhub.sh index 85c42ca..b25dfc2 100644 --- a/dockerhub.sh +++ b/dockerhub.sh @@ -40,6 +40,9 @@ CARGO_SERVER_SSL_KEY_BASE64=$(echo "$CARGO_SERVER_SSL_KEY" | base64 -w 0) # Alpine # docker buildx build --push --build-arg TAGORELAY_VERSION=${FULL_VERSION} \ +# --build-arg CARGO_SERVER_SSL_CA=${CARGO_SERVER_SSL_CA_BASE64} \ +# --build-arg CARGO_SERVER_SSL_CERT=${CARGO_SERVER_SSL_CERT_BASE64} \ +# --build-arg CARGO_SERVER_SSL_KEY=${CARGO_SERVER_SSL_KEY_BASE64} \ # --platform linux/arm64/v8,linux/amd64 \ # --tag tagoio/relay:alpine \ # --tag tagoio/relay:${MAJOR}.${MINOR}-alpine \ @@ -50,7 +53,7 @@ docker buildx build --push --build-arg TAGORELAY_VERSION=${FULL_VERSION} \ --build-arg CARGO_SERVER_SSL_CA=${CARGO_SERVER_SSL_CA_BASE64} \ --build-arg CARGO_SERVER_SSL_CERT=${CARGO_SERVER_SSL_CERT_BASE64} \ --build-arg CARGO_SERVER_SSL_KEY=${CARGO_SERVER_SSL_KEY_BASE64} \ - --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \ + --platform linux/arm/v7,linux/amd64 \ --tag tagoio/relay \ --tag tagoio/relay:debian \ --tag tagoio/relay:bullseye \