forked from github-starred/komodo
Reduce periphery image size (#82)
* Reduce periphery image size * rename new alpine Dockerfile as slim.Dockerfile * bump slim dockerfile rust version --------- Co-authored-by: mbecker20 <becker.maxh@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# Build Periphery
|
||||
FROM rust:1.80.1-bookworm AS builder
|
||||
FROM rust:1.81.0-bookworm AS builder
|
||||
WORKDIR /builder
|
||||
COPY . .
|
||||
RUN cargo build -p komodo_periphery --release
|
||||
|
||||
29
bin/periphery/slim.Dockerfile
Normal file
29
bin/periphery/slim.Dockerfile
Normal file
@@ -0,0 +1,29 @@
|
||||
# Build Periphery
|
||||
FROM rust:1.81.0-alpine AS builder
|
||||
WORKDIR /builder
|
||||
COPY . .
|
||||
RUN apk update && apk --no-cache add musl-dev openssl-dev openssl-libs-static
|
||||
RUN cargo build -p komodo_periphery --release
|
||||
|
||||
# Final Image
|
||||
FROM alpine:3.20
|
||||
|
||||
# Install Deps
|
||||
RUN apk update && apk add docker-cli docker-cli-compose openssl git git-lfs bash
|
||||
|
||||
# Setup an application directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy
|
||||
COPY --from=builder /builder/target/release/periphery /app
|
||||
|
||||
# Hint at the port
|
||||
EXPOSE 8120
|
||||
|
||||
# Label for Ghcr
|
||||
LABEL org.opencontainers.image.source=https://github.com/mbecker20/komodo
|
||||
LABEL org.opencontainers.image.description="Komodo Periphery"
|
||||
LABEL org.opencontainers.image.licenses=GPL-3.0
|
||||
|
||||
# Using ENTRYPOINT allows cli args to be passed, eg using "command" in docker compose.
|
||||
ENTRYPOINT [ "/app/periphery" ]
|
||||
Reference in New Issue
Block a user