Skip to content

Commit

Permalink
ci: add ockam docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
metaclips committed Nov 10, 2024
1 parent efd0305 commit b9ada4d
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 18 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/release-draft-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 5 additions & 10 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -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"
6 changes: 0 additions & 6 deletions implementations/rust/ockam/ockam_command/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 20 additions & 2 deletions tools/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions tools/docker/ockam/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM cgr.dev/chainguard/glibc-dynamic@sha256:0c09bcfc6a1f8755b7a20bd7550e0448adc75d75d22baddd57d9b87577d3f8b4
ARG BINARY_PATH

COPY --chown=nonroot ${BINARY_PATH}/ockam /
ENTRYPOINT ["/ockam"]

0 comments on commit b9ada4d

Please sign in to comment.