Skip to content

Instantly share code, notes, and snippets.

@eKristensen
Created February 3, 2024 18:58
Show Gist options
  • Save eKristensen/cb22a5018399c71a3cf99a584219a880 to your computer and use it in GitHub Desktop.
Save eKristensen/cb22a5018399c71a3cf99a584219a880 to your computer and use it in GitHub Desktop.
vigil aarch64 podman / docker build
FROM docker.io/rustlang/rust:nightly-alpine AS build
RUN apk add --no-cache musl-dev perl make
RUN rustup --version
RUN rustup target add aarch64-unknown-linux-musl
RUN rustc --version && \
rustup --version && \
cargo --version
WORKDIR /app
COPY . /app
RUN cargo clean
RUN CFLAGS=-mno-outline-atomics cargo build --release --target aarch64-unknown-linux-musl
RUN strip ./target/aarch64-unknown-linux-musl/release/vigil
FROM docker.io/alpine:latest
WORKDIR /usr/src/vigil
COPY ./res/assets/ ./res/assets/
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /app/target/aarch64-unknown-linux-musl/release/vigil /usr/local/bin/vigil
CMD [ "vigil", "-c", "/etc/vigil.cfg" ]
EXPOSE 8080
@eKristensen
Copy link
Author

eKristensen commented Feb 3, 2024

Tested on Hetzner CAX11 with 2 Ampere vCPU (Arm64) with Rocky Linux 9 using rootless podman where the Dockerfile in this gist is replacing the one in this commit: valeriansaliou/vigil@78100ca

Hints:

Combined it could be something like
podman run -p 8080:8080 -v ./config.cfg:/etc/vigil.cfg:z --cap-add=net_raw [container ID]

Note: I never manged to get IPv6 working from within the container with rootless podman on Rocky Linux 9. It might be possible, I am just not sure how...

@NBSUKLTD
Copy link

Currently the nightly build is throwing this when compiling.

#![cfg_attr(feature = "stdsimd", feature(stdsimd))]
=> => # | ^^^^^^^
=> => # For more information about this error, try rustc --explain E0635

@eKristensen
Copy link
Author

https://doc.rust-lang.org/error_codes/E0635.html

The source code refers to an non exisiting feature. It must be upstream somewhere.

It looks like the feature has been removed from Rust: https://users.rust-lang.org/t/error-e0635-unknown-feature-stdsimd/106445/2

A hotfix could be to use stable Rust maybe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment