diff --git a/.github/workflows/static_build.yml b/.github/workflows/static_build.yml index 88d07c9dd6..c9409d3fdf 100644 --- a/.github/workflows/static_build.yml +++ b/.github/workflows/static_build.yml @@ -8,10 +8,6 @@ jobs: test-release: name: Build for Linux runs-on: ubuntu-latest - container: - image: ekidd/rust-musl-builder - volumes: - - ${{ github.workspace }}:/home/rust/src env: CARGO_TERM_COLOR: always steps: @@ -19,13 +15,12 @@ jobs: - name: Build-musl run: | echo "Building static binaries using ekidd/rust-musl-builder" - sudo chown rust -R /opt/rust/ - rustup target add x86_64-unknown-linux-musl - RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition" cargo build --release --features=auth - - name: run fastn - run: ./target/x86_64-unknown-linux-musl/release/fastn --version + docker build -t fastn-build-image . + docker run -it --name fastn-build fastn-build-image + mkdir -p out + docker cp fastn-build:/home/rust/src/target/x86_64-unknown-linux-musl/release/fastn out/ - name: ls files run: | ls target/ - ls target/x86_64-unknown-linux-musl/release/fastn - file target/x86_64-unknown-linux-musl/release/fastn + ls out/ + file out/fastn diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..8ff870b444 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM ekidd/rust-musl-builder + +# We need to add the source code to the image because `rust-musl-builder` +# assumes a UID of 1000 +ADD --chown=rust:rust . ./ + +CMD RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition" cargo build --release --features=auth