diff --git a/Dockerfile b/Dockerfile index 457e805..48008ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,5 @@ +# syntax = docker/dockerfile:1.2 + # We use a multi-stage build to end up with a very small final image FROM alpine:latest AS builder @@ -18,8 +20,8 @@ COPY src/ ./src/ # Thank the lords that this article exists # https://users.rust-lang.org/t/sigsegv-with-program-linked-against-openssl-in-an-alpine-container/52172 # TODO add what these flags do & why they work -RUN RUSTFLAGS="-C target-feature=-crt-static" cargo test && \ - RUSTFLAGS="-C target-feature=-crt-static" cargo build --release --bin fej +RUN --mount=type=cache,target=/usr/src/app/target RUSTFLAGS="-C target-feature=-crt-static" cargo test && \ + RUSTFLAGS="-C target-feature=-crt-static" cargo install --path . --bin fej --root /usr/local/bin # Now, we create the actual image @@ -29,6 +31,6 @@ FROM alpine:latest RUN apk update && apk add --no-cache openssl libgcc # Copy binary over to final image -COPY --from=builder /usr/src/app/target/release/fej /usr/local/bin/fej +COPY --from=builder /usr/local/bin/fej /usr/local/bin/fej CMD ["/usr/local/bin/fej"] diff --git a/build b/build index 0117f6a..8abbc39 100755 --- a/build +++ b/build @@ -26,7 +26,7 @@ else fi # Run the actual build command -docker build -t "$1:$tags" . +DOCKER_BUILDKIT=1 docker build -t "$1:$tags" . if [[ "$2" = push ]]; then [[ "$branch" =~ ^develop|master$ ]] || { diff --git a/src/ivago/README.md b/src/ivago/README.md index c69c1b4..02d2d0e 100644 --- a/src/ivago/README.md +++ b/src/ivago/README.md @@ -1,5 +1,5 @@ # Ivago This part of the API is a wrapper around the Ivago website (Ivago being the -company that collects the trash in my city). Their city isn't exactly RESTful, +company that collects the trash in my city). Their site isn't exactly RESTful, so this endpoint simply wraps it in a RESTful wrapper.