docker build -t vector-dev:alpine --target=final .
docker run --rm \
-v ~/Documents/opensource/vector:/workspace \
-v /var/run/docker.sock:/var/run/docker.sock \
-it vector-dev:alpine sh
Run inside the container
# https://github.com/vectordotdev/vector/blob/c3c0ec0cf34f4d5defa19458a76e4e69678ee2a2/scripts/cross/x86_64-unknown-linux-musl.dockerfile
# pre-build cross-image
docker build --tag vector-cross-env:x86_64-unknown-linux-musl \
--file scripts/cross/x86_64-unknown-linux-musl.dockerfile .
# cargo build
CROSS_CONTAINER_IN_CONTAINER=1 cross build \
--release --target x86_64-unknown-linux-musl \
--no-default-features --features target-x86_64-unknown-linux-musl
nix develop .#x86_64-unknown-linux-musl
cargo build \
--release --target x86_64-unknown-linux-musl \
--no-default-features --features target-x86_64-unknown-linux-musl