diff options
author | fx <[email protected]> | 2023-10-15 02:26:29 +0200 |
---|---|---|
committer | fx <[email protected]> | 2023-10-15 02:26:29 +0200 |
commit | 0948f75248a5daf8229ce1f40d1b3ec8d9aecbac (patch) | |
tree | 753359f0a74c44f31e6fa7e9ab5d7d404b8092b9 | |
parent | d109f789b1cb75fc144a203628694dfb7ed300cb (diff) | |
download | webol-0948f75248a5daf8229ce1f40d1b3ec8d9aecbac.tar webol-0948f75248a5daf8229ce1f40d1b3ec8d9aecbac.tar.gz webol-0948f75248a5daf8229ce1f40d1b3ec8d9aecbac.zip |
test w/ cargo chef + arm64
-rw-r--r-- | .github/workflows/test.yml | 7 | ||||
-rw-r--r-- | Dockerfile | 27 | ||||
-rw-r--r-- | Dockerfile.arm.build | 16 | ||||
-rw-r--r-- | Dockerfile.build | 18 | ||||
-rw-r--r-- | build.rs.disabled (renamed from nobuild.rs.old) | 0 |
5 files changed, 26 insertions, 42 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ed9fba6..649f295 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml | |||
@@ -51,9 +51,8 @@ jobs: | |||
51 | id: docker_build | 51 | id: docker_build |
52 | uses: docker/build-push-action@v3 | 52 | uses: docker/build-push-action@v3 |
53 | with: | 53 | with: |
54 | file: Dockerfile.build | ||
55 | push: true | 54 | push: true |
56 | platforms: linux/amd64,linux/arm/v7 | 55 | platforms: linux/amd64,linux/arm64 |
57 | tags: | | 56 | tags: | |
58 | ghcr.io/fxqnlr/webol:test-latest | 57 | ghcr.io/fxqnlr/webol:latest |
59 | ghcr.io/fxqnlr/webol:test-${{ github.run_number }} | 58 | ghcr.io/fxqnlr/webol:${{ github.run_number }} \ No newline at end of file |
@@ -1,7 +1,26 @@ | |||
1 | FROM --platform=amd64 debian:bullseye-slim | 1 | FROM debian:bookworm AS deb_extractor |
2 | RUN cd /tmp && \ | ||
3 | apt-get update && apt-get download \ | ||
4 | libc6 && \ | ||
5 | mkdir /dpkg && \ | ||
6 | for deb in *.deb; do dpkg --extract $deb /dpkg || exit 10; done | ||
2 | 7 | ||
3 | WORKDIR /usr/local/webol | 8 | FROM lukemathwalker/cargo-chef:latest-rust-1.73.0 as chef |
4 | COPY target/armv7-unknown-linux-gnueabihf/release/webol /usr/local/bin/webol | 9 | WORKDIR app |
10 | |||
11 | FROM chef AS planner | ||
12 | COPY . . | ||
13 | RUN cargo chef prepare --recipe-path recipe.json | ||
14 | |||
15 | FROM chef as builder | ||
16 | COPY --from=planner /app/recipe.json recipe.json | ||
17 | RUN cargo chef cook --release --recipe-path recipe.json | ||
18 | COPY . . | ||
19 | RUN cargo build --release | ||
20 | |||
21 | FROM gcr.io/distroless/cc | ||
22 | COPY --from=builder /app/target/release/webol / | ||
23 | COPY --from=deb_extractor /dpkg / | ||
5 | 24 | ||
6 | EXPOSE 7229 | 25 | EXPOSE 7229 |
7 | CMD ["webol"] \ No newline at end of file | 26 | ENTRYPOINT ["./webol"] |
diff --git a/Dockerfile.arm.build b/Dockerfile.arm.build deleted file mode 100644 index 1845afe..0000000 --- a/Dockerfile.arm.build +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | FROM rust:1.73 as builder | ||
2 | WORKDIR /usr/src/webol | ||
3 | COPY . . | ||
4 | #RUN rustup target add armv7-unknown-linux-gnueabihf | ||
5 | #RUN apt update && apt install gcc-arm-linux-gnueabihf -y | ||
6 | #RUN CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc cargo install --path . --target armv7-unknown-linux-gnueabihf | ||
7 | RUN cargo install --path . | ||
8 | |||
9 | #FROM --platform=arm64 debian:bookworm-slim | ||
10 | FROM debian:bookworm-slim | ||
11 | RUN apt update && apt install -y libc6 && rm -rf /var/lib/apt/lists/* | ||
12 | WORKDIR /usr/local/webol | ||
13 | COPY --from=builder /usr/local/cargo/bin/webol /usr/local/bin/webol | ||
14 | |||
15 | EXPOSE 7229 | ||
16 | CMD ["webol"] | ||
diff --git a/Dockerfile.build b/Dockerfile.build deleted file mode 100644 index 0158b8a..0000000 --- a/Dockerfile.build +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | FROM debian:bookworm AS deb_extractor | ||
2 | RUN cd /tmp && \ | ||
3 | apt-get update && apt-get download \ | ||
4 | libc6 && \ | ||
5 | mkdir /dpkg && \ | ||
6 | for deb in *.deb; do dpkg --extract $deb /dpkg || exit 10; done | ||
7 | |||
8 | FROM rust:1.73 as builder | ||
9 | WORKDIR /app | ||
10 | COPY . . | ||
11 | RUN cargo build --release | ||
12 | |||
13 | FROM gcr.io/distroless/cc | ||
14 | COPY --from=builder /app/target/release/webol / | ||
15 | COPY --from=deb_extractor /dpkg / | ||
16 | |||
17 | EXPOSE 7229 | ||
18 | ENTRYPOINT ["./webol"] | ||
diff --git a/nobuild.rs.old b/build.rs.disabled index 7609593..7609593 100644 --- a/nobuild.rs.old +++ b/build.rs.disabled | |||