-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (36 loc) · 1.36 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
FROM ghcr.io/ehsaniara/delay-box:latest AS builder
# Install curl
FROM debian:10 AS curl-installer
RUN apt-get update && apt-get install -y busybox curl --no-install-recommends && rm -rf /var/lib/apt/lists/*
# Create the final image for amd64 architecture
FROM scratch AS amd64
WORKDIR /app
COPY --from=builder /app/main /app/
COPY --from=curl-installer /bin/busybox /bin/sh
COPY --from=curl-installer /bin/busybox /bin/date
COPY --from=curl-installer /usr/bin/curl /usr/bin/curl
COPY --from=curl-installer /lib/x86_64-linux-gnu /lib/
COPY --from=curl-installer /usr/lib/x86_64-linux-gnu /usr/lib/
# Expose the port the app runs on
EXPOSE 8088
# Set the default environment variable
ENV APP_PATH=./config/config.yaml
# Command to run the application
CMD ["/app/main"]
# Create the final image for arm64 architecture
FROM scratch AS arm64
WORKDIR /app
COPY --from=builder /app/main /app/
COPY --from=curl-installer /bin/busybox /bin/sh
COPY --from=curl-installer /bin/busybox /bin/date
COPY --from=curl-installer /usr/bin/curl /usr/bin/curl
COPY --from=curl-installer /lib/aarch64-linux-gnu /lib/
COPY --from=curl-installer /usr/lib/aarch64-linux-gnu /usr/lib/
# Expose the port the app runs on
EXPOSE 8088
# Set the default environment variable
ENV APP_PATH=./config/config.yaml
# Command to run the application
CMD ["/app/main"]
# Create the final multi-arch image
FROM ${TARGETARCH}