-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from GitGab19/optimize-builder-images
Docker images optimization + docker-compose adjustment
- Loading branch information
Showing
11 changed files
with
160 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
FROM rust:1.75 as builder | ||
WORKDIR usr/src/log-server | ||
COPY ./log-server . | ||
# Build stage | ||
FROM rust:1.75-alpine AS builder | ||
|
||
WORKDIR /usr/src/log-server | ||
COPY . . | ||
|
||
# Install necessary dependencies | ||
RUN apk add musl-dev pkgconfig libressl-dev | ||
|
||
# Build the project in release mode | ||
RUN cargo build --release | ||
|
||
FROM rust:1.75 | ||
COPY --from=builder usr/src/log-server/ usr/src/log-server/ | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
iproute2 \ | ||
iputils-ping \ | ||
iptables \ | ||
curl | ||
WORKDIR /usr/src/log-server/ | ||
# Final stage | ||
FROM alpine:latest | ||
|
||
# Copy only the binary from the builder image | ||
COPY --from=builder /usr/src/log-server/target/release/log-server /usr/local/bin/log-server | ||
|
||
# Set the working directory | ||
WORKDIR /usr/local/bin/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,29 @@ | ||
FROM rust:1.75 as builder | ||
WORKDIR usr/src/pools-latency-calculator | ||
COPY ./pools-latency-calculator/ . | ||
# Build stage | ||
FROM rust:1.75-alpine AS builder | ||
|
||
WORKDIR /usr/src/pools-latency-calculator | ||
|
||
# Install necessary dependencies for building | ||
RUN apk add --no-cache musl-dev pkgconfig libressl-dev | ||
|
||
# Copy the source code into the container | ||
COPY pools-latency-calculator/ . | ||
|
||
# Build the project in release mode | ||
RUN cargo build --release | ||
|
||
FROM rust:1.75 | ||
COPY --from=builder /usr/src/pools-latency-calculator/ /usr/src/pools-latency-calculator/ | ||
WORKDIR /usr/src/pools-latency-calculator/ | ||
# Final stage | ||
FROM alpine:latest | ||
|
||
# Install necessary runtime dependencies | ||
RUN apk update && apk add --no-cache \ | ||
iproute2 \ | ||
iputils-ping \ | ||
iptables \ | ||
curl | ||
|
||
# Copy the compiled binary from the builder stage | ||
COPY --from=builder /usr/src/pools-latency-calculator/target/release/pools-latency-calculator /usr/local/bin/pools-latency-calculator | ||
|
||
# Set the working directory | ||
WORKDIR /usr/local/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,31 @@ | ||
FROM rust:1.75 as builder | ||
WORKDIR usr/src/sv1-custom-proxy | ||
# Build stage | ||
FROM rust:1.75-alpine AS builder | ||
|
||
WORKDIR /usr/src/sv1-custom-proxy | ||
COPY ./sv1-custom-proxy . | ||
|
||
# Install necessary dependencies for building | ||
RUN apk add musl-dev pkgconfig libressl-dev | ||
|
||
# Build the project in release mode | ||
RUN cargo build --release | ||
|
||
FROM rust:1.75 | ||
COPY --from=builder usr/src/sv1-custom-proxy/ usr/src/sv1-custom-proxy/ | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
# Final stage | ||
FROM alpine:latest | ||
|
||
# Install necessary runtime dependencies | ||
RUN apk update && apk add --no-cache \ | ||
iproute2 \ | ||
iputils-ping \ | ||
iptables \ | ||
curl | ||
WORKDIR /usr/src/sv1-custom-proxy/ | ||
curl | ||
|
||
# Copy the binary from the builder stage | ||
COPY --from=builder /usr/src/sv1-custom-proxy/target/release/sv1-custom-proxy /usr/local/bin/sv1-custom-proxy | ||
|
||
# Set the working directory | ||
WORKDIR /usr/local/bin/ | ||
|
||
# Copy the script and make it executable | ||
COPY ./pools-latency-calculator/monitor_and_apply_latency.sh /usr/local/bin/monitor_and_apply_latency.sh | ||
RUN chmod +x /usr/local/bin/monitor_and_apply_latency.sh |
Oops, something went wrong.