Dockerfile 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # This Dockerfile is composed of two steps: the first one builds the release
  2. # binary, and then the binary is copied inside another, empty image.
  3. #################
  4. # Build image #
  5. #################
  6. FROM ubuntu:bionic AS build
  7. RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
  8. --no-install-recommends \
  9. ca-certificates \
  10. curl \
  11. gcc g++ \
  12. pkg-config \
  13. libssl-dev
  14. RUN curl https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init >/tmp/rustup-init && \
  15. chmod +x /tmp/rustup-init && \
  16. /tmp/rustup-init -y --no-modify-path --default-toolchain stable --profile minimal
  17. ENV PATH=/root/.cargo/bin:$PATH
  18. WORKDIR /tmp/source
  19. COPY . /tmp/source/
  20. RUN cargo build --release
  21. ##################
  22. # Output image #
  23. ##################
  24. FROM ubuntu:bionic AS binary
  25. RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
  26. ca-certificates
  27. COPY --from=build /tmp/source/target/release/triagebot /usr/local/bin/
  28. ENV PORT=80
  29. CMD triagebot