ci: Support for arm64 docker builds

This commit is contained in:
2024-12-13 21:40:53 -07:00
parent 1128937cac
commit 3c99b38db7
6 changed files with 58 additions and 5 deletions
+8 -1
View File
@@ -317,7 +317,14 @@ jobs:
- name: Push to Docker Hub
uses: docker/build-push-action@v5
with:
tags: darkalex17/managarr:latest, darkalex17/managarr:${{ env.version }}
tags: darkalex17/managarr:latest, darkalex17/managarr:x86_64, darkalex17/managarr:x86_64-${{ env.version }}
push: true
- name: Push to Docker Hub
uses: docker/build-push-action@v5
with:
file: Dockerfile.arm64
tags: darkalex17/managarr:arm64, darkalex17/managarr:arm64-${{ env.version }}
push: true
publish-crate:
Generated
+11
View File
@@ -1441,6 +1441,7 @@ dependencies = [
"managarr-tree-widget",
"mockall",
"mockito",
"openssl",
"paste",
"pretty_assertions",
"ratatui",
@@ -1673,6 +1674,15 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]]
name = "openssl-src"
version = "300.4.0+3.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a709e02f2b4aca747929cca5ed248880847c650233cf8b8cdc48f40aaf4898a6"
dependencies = [
"cc",
]
[[package]]
name = "openssl-sys"
version = "0.9.104"
@@ -1681,6 +1691,7 @@ checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741"
dependencies = [
"cc",
"libc",
"openssl-src",
"pkg-config",
"vcpkg",
]
+1
View File
@@ -53,6 +53,7 @@ indicatif = "0.17.9"
derive_setters = "0.1.6"
deunicode = "1.6.0"
paste = "1.0.15"
openssl = { version = "0.10.68", features = ["vendored"] }
[dev-dependencies]
assert_cmd = "2.0.16"
+3 -3
View File
@@ -1,4 +1,4 @@
FROM clux/muslrust:stable AS builder
FROM messense/rust-musl-cross:x86_64-musl AS builder
WORKDIR /usr/src
# Download and compile Rust dependencies in an empty project and cache as a separate Docker layer
@@ -6,7 +6,7 @@ RUN USER=root cargo new --bin managarr-temp
WORKDIR /usr/src/managarr-temp
COPY Cargo.* .
RUN cargo build --release --target x86_64-unknown-linux-musl
RUN cargo build --release
# remove src from empty project
RUN rm -r src
COPY src ./src
@@ -15,7 +15,7 @@ RUN rm ./target/x86_64-unknown-linux-musl/release/deps/managarr*
RUN --mount=type=cache,target=/volume/target \
--mount=type=cache,target=/root/.cargo/registry \
cargo build --release --target x86_64-unknown-linux-musl --bin managarr
cargo build --release --bin managarr
RUN mv target/x86_64-unknown-linux-musl/release/managarr .
FROM debian:stable-slim
+27
View File
@@ -0,0 +1,27 @@
FROM messense/rust-musl-cross:armv7-musleabihf AS builder
WORKDIR /usr/src
# Download and compile Rust dependencies in an empty project and cache as a separate Docker layer
RUN USER=root cargo new --bin managarr-temp
RUN apt update && apt install -y libssl-dev pkg-config
WORKDIR /usr/src/managarr-temp
COPY Cargo.* .
RUN cargo build --release
# remove src from empty project
RUN rm -r src
COPY src ./src
# remove previous deps
RUN rm ./target/armv7-unknown-linux-musleabihf/release/deps/managarr*
RUN --mount=type=cache,target=/volume/target \
--mount=type=cache,target=/root/.cargo/registry \
cargo build --release --bin managarr
RUN mv target/armv7-unknown-linux-musleabihf/release/managarr .
FROM debian:stable-slim
# Copy the compiled binary from the builder container
COPY --from=builder --chown=nonroot:nonroot /usr/src/managarr-temp/managarr /usr/local/bin
ENTRYPOINT [ "/usr/local/bin/managarr" ]
+8 -1
View File
@@ -49,13 +49,20 @@ cargo install --locked managarr
### Docker
Run Managarr as a docker container by mounting your `config.yml` file to `/root/.config/managarr/config.yml`. For example:
```shell
docker run --rm -it -v ~/.config/managarr/config.yml:/root/.config/managarr/config.yml darkalex17/managarr
docker run --rm -it -v /home/aclarke/.config/managarr/config.yml:/root/.config/managarr/config.yml darkalex17/managarr:latest
```
For ARM64 users, you can use the `arm64` tag:
```shell
docker run --rm -it -v /home/aclarke/.config/managarr/config.yml:/root/.config/managarr/config.yml darkalex17/managarr:arm64
```
You can also clone this repo and run `make docker` to build a docker image locally and run it using the above command.
Please note that you will need to create and popular your configuration file first before starting the container. Otherwise, the container will fail to start.
**Note:** If you run into errors using relative file paths when mounting the volume with the configuration file, try using an absolute path.
### Manual
Binaries are available on the [releases](https://github.com/Dark-Alex-17/managarr/releases) page for the following platforms: