diff --git a/.github/workflows/release-draft-binaries.yml b/.github/workflows/release-draft-binaries.yml index 9ee9c63c333..829d3ae5b7f 100644 --- a/.github/workflows/release-draft-binaries.yml +++ b/.github/workflows/release-draft-binaries.yml @@ -220,6 +220,13 @@ jobs: use-cross-build: false build_app: true build_command: false + - build: linux_aarch64_gnu + os: ubuntu-22.04 + toolchain: stable + target: aarch64-unknown-linux-gnu + use-cross-build: false + build_app: true + build_command: true - build: macos_silicon os: macos-14 toolchain: stable diff --git a/Cross.toml b/Cross.toml index 03ac21c5a10..693681d5321 100644 --- a/Cross.toml +++ b/Cross.toml @@ -1,12 +1,7 @@ [build] # additional commands to run prior to building the package -pre-build = [ - "apt update", - # libclang-dev is required when building with `aws-lc` feature - # we need the external llvm repository to cross compile for linux-gnu-unknown/amd64 - "DEBIAN_FRONTEND=noninteractive apt -y --no-install-recommends install cmake apt-transport-https libclang-dev clang", - "echo deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial main > /etc/apt/llvm.list", - "curl --proto '=https' --tlsv1.2 -sSfL https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -", - "apt update", - "DEBIAN_FRONTEND=noninteractive apt -y --no-install-recommends install libclang-8-dev", -] +# Specify settings for the x86_64-unknown-linux-gnu target +[target.aarch64-unknown-linux-gnu] +image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main" +[target.x86_64-unknown-linux-gnu] +image = "ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main" diff --git a/implementations/rust/ockam/ockam_command/Cargo.toml b/implementations/rust/ockam/ockam_command/Cargo.toml index e115eb5c061..7f8783be350 100644 --- a/implementations/rust/ockam/ockam_command/Cargo.toml +++ b/implementations/rust/ockam/ockam_command/Cargo.toml @@ -27,12 +27,6 @@ repository = "https://github.com/build-trust/ockam/implementations/rust/ockam/oc rust-version = "1.70.0" description = "End-to-end encryption and mutual authentication for distributed applications." -[package.metadata.cross.target.aarch64-unknown-linux-musl] -dockerfile = "../../../../tools/cross/Cross.Dockerfile.aarch64" - -[package.metadata.cross.target.armv7-unknown-linux-musleabihf] -dockerfile = "../../../../tools/cross/Cross.Dockerfile.armv7" - [[bin]] # You may be wondering "Why are the tests and docs disabled?". The long and # short of it is: To avoid certain bugs in `rustdoc`, `cargo`, and other tools diff --git a/tools/docker/README.md b/tools/docker/README.md index 6f748d336a1..a15564742c0 100644 --- a/tools/docker/README.md +++ b/tools/docker/README.md @@ -12,10 +12,28 @@ docker build \ tools/docker/builder ``` -Run the builder: +## Ockam + +This docker image creates an Ockam image, binary is required to be prebuilt locally as a `musl build` preferrably using [cargo-cross](https://github.com/cross-rs/cross) and then imported to your docker image. + +From the root directory: + + +```bash +cross build --bin ockam --target "$target" --no-default-features -F ockam_command/aws-lc -F ockam_command/orchestrator; +docker build \ + --tag ockam:latest \ + --tag ghcr.io/build-trust/ockam:latest \ + --file tools/docker/ockam/Dockerfile \ + --build-arg BINARY_PATH="$PATH_TO_BINARY" . + +# Where BINARY_PATH is the path to where your pre-built `musl` Ockam binary is located. +``` + +Run Ockam image: ``` -docker run --rm -it -e HOST_USER_ID=$(id -u) --volume $(pwd):/work ockam-builder:latest bash +docker run --rm -it ockam:latest --help ``` ## Cloud node diff --git a/tools/docker/ockam/Dockerfile b/tools/docker/ockam/Dockerfile new file mode 100644 index 00000000000..e1658943987 --- /dev/null +++ b/tools/docker/ockam/Dockerfile @@ -0,0 +1,5 @@ +FROM cgr.dev/chainguard/glibc-dynamic@sha256:0c09bcfc6a1f8755b7a20bd7550e0448adc75d75d22baddd57d9b87577d3f8b4 +ARG BINARY_PATH + +COPY --chown=nonroot ${BINARY_PATH}/ockam / +ENTRYPOINT ["/ockam"]