File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ FROM rust:1-alpine3.18
2+
3+ ENV CARGO_BUILD_TARGET=x86_64-unknown-linux-musl
4+
5+ RUN apk update && \
6+ apk add bash musl-dev shadow && \
7+ # Add a user for floki using the shadow utils
8+ useradd -Um -s /bin/bash floki
9+
10+ USER floki
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " floki" ,
3+ "build" : { "dockerfile" : " Dockerfile.alpine" },
4+ "remoteUser" : " floki"
5+ }
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ Status: Available for use
2121- Add ` toml ` function to tera templating engine so that floki templates
2222 can use ` toml(file="<filepath>") ` in order to load values.
2323- Add ` floki render ` to print out the rendered configuration template.
24+ - Switch rust image to ` rust:1-alpine3.18 ` as it's better maintained.
2425
2526### Fixed
2627
Original file line number Diff line number Diff line change @@ -20,9 +20,15 @@ echo "Starting release build for ${LABEL}"
2020if [ ${OS_ID} = " linux" ]
2121then
2222 echo " Building statically linked linux binary"
23- docker run --rm -v $( pwd) :/home/rust/src -w /home/rust/src ekidd/rust-musl-builder \
24- sh -c ' sudo chown -R rust:rust . && cargo build --release && cp target/x86_64-unknown-linux-musl/release/floki .'
23+ docker build -f .devcontainer/Dockerfile.alpine -t flokirust .
24+
25+ docker run --rm -v $( pwd) :/src -w /src flokirust \
26+ sh -c ' cargo build --release && cp target/x86_64-unknown-linux-musl/release/floki .'
2527 sudo chown -R $( id -u) :$( id -g) .
28+
29+ # Check that it's statically compiled!
30+ ldd floki
31+
2632 tar -cvzf floki-${LABEL} .tar.gz floki
2733
2834else
Original file line number Diff line number Diff line change 1- image : ekidd/rust-musl-builder
2- mount : /home/rust/src
1+ image :
2+ build :
3+ name : flokirust
4+ dockerfile : .devcontainer/Dockerfile.alpine
5+ context : .
6+
7+ volumes :
8+ alpine-cargo-registry :
9+ mount : /usr/local/cargo/registry
10+
311forward_ssh_agent : true
412shell : bash
You can’t perform that action at this time.
0 commit comments