Skip to content

Commit 99810bc

Browse files
fix docker files
1 parent b20af55 commit 99810bc

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

op-defender/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Define the build stage
2-
FROM dhi.io/golang:1.22.2-alpine3.19 as builder
2+
FROM dhi.io/golang:1.24-alpine3.22-dev as builder
33

44
# Set the working directory inside the container
55
WORKDIR /app
@@ -13,14 +13,14 @@ COPY . .
1313
# Run the Makefile command to build the binary
1414
RUN make
1515

16+
# Ensure the binary is executable
17+
RUN chmod +x /app/bin/defender
18+
1619
# Define the final base image
17-
FROM dhi.io/alpine:3.18
20+
FROM dhi.io/alpine-base:3.22
1821

1922
# Copy the built binary from the builder stage
2023
COPY --from=builder /app/bin/defender /usr/local/bin/defender
2124

22-
# Ensure the binary is executable
23-
RUN chmod +x /usr/local/bin/defender
24-
2525
# Set the command to run the binary
2626
CMD ["defender"]

op-monitorism/Dockerfile

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,23 @@
11
# Define the build stage
2-
FROM golang:1.22.2-alpine3.19 AS builder
2+
FROM dhi.io/golang:1.24-alpine3.22-dev AS builder
33

44
# Set the working directory inside the container
55
WORKDIR /app
66

7-
# Install system dependencies including 'make'
8-
RUN apk update && apk add --no-cache make
9-
107
# Copy the source code and Makefile into the container
118
COPY . .
129

1310
# Run the Makefile command to build the binary
1411
RUN make
1512

16-
# Define the final base image
17-
FROM dhi.io/alpine:3.18
13+
# Ensure the binary is executable
14+
RUN chmod +x /app/bin/monitorism
1815

19-
# Install ca-certificates so that HTTPS works
20-
RUN apk update && apk add --no-cache ca-certificates
16+
# Define the final base image
17+
FROM dhi.io/alpine-base:3.22
2118

2219
# Copy the built binary from the builder stage
2320
COPY --from=builder /app/bin/monitorism /usr/local/bin/monitorism
2421

25-
# Ensure the binary is executable
26-
RUN chmod +x /usr/local/bin/monitorism
27-
2822
# Set the command to run the binary
2923
CMD ["monitorism"]

0 commit comments

Comments
 (0)