diff --git a/.dockerignore b/.dockerignore index 614c7dd..aa9bcf8 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,3 +6,6 @@ # Cargo files !Cargo.toml !Cargo.lock + +# Entrypoint for devop container +!docker/entrypoint_dev.sh diff --git a/docker/Dockerfile.builder b/docker/Dockerfile.builder index 4d04e9b..126a302 100644 --- a/docker/Dockerfile.builder +++ b/docker/Dockerfile.builder @@ -8,8 +8,9 @@ ENV RUSTFLAGS "-C target-feature=-crt-static" WORKDIR /usr/src/app # Install build dependencies, rustup & rust's nightly build & toolchain -RUN apk update && apk add --no-cache openssl-dev build-base curl libpq && \ - { curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly; } +RUN apk update && apk add --no-cache openssl-dev curl libpq libgcc musl-dev gcc && \ + { curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly; } && \ + rustup target add x86_64-unknown-linux-musl --toolchain nightly # Copy source code over to builder COPY Cargo.toml Cargo.lock ./ diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev index d2029af..7281bc3 100644 --- a/docker/Dockerfile.dev +++ b/docker/Dockerfile.dev @@ -2,5 +2,7 @@ FROM chewingbever/fej-builder:latest ENV RUST_BACKTRACE 1 -ENTRYPOINT ["cargo"] +COPY ./docker/entrypoint_dev.sh /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] CMD ["run", "--bin", "server"] diff --git a/docker/entrypoint_dev.sh b/docker/entrypoint_dev.sh new file mode 100755 index 0000000..0838bce --- /dev/null +++ b/docker/entrypoint_dev.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +# All this file does is inject the target +cargo "$@" --target x86_64-unknown-linux-musl diff --git a/fejctl b/fejctl index acaaeee..ee4cf8e 100755 --- a/fejctl +++ b/fejctl @@ -28,6 +28,10 @@ function create_images() { # # $@: the arguments to pass to the image (passed as arguments to cargo) function run_image() { + docker volume create fej_build-cache + docker volume create fej_registry-cache + docker volume create fej_db-data + # Run the database image docker run --rm \ --detach \