forked from keploy/keploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·47 lines (34 loc) · 1.16 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
47
# === Build Stage ===
FROM golang:1.21 AS build
# Set the working directory
WORKDIR /app
# Copy the Go module files and download dependencies
COPY go.mod go.sum /app/
RUN go mod download
# Copy the contents of the current directory into the build container
COPY . /app
# Build the keploy binary
RUN go build -o keploy .
# === Runtime Stage ===
FROM debian:bookworm-slim
ENV IS_DOCKER_CMD=true
# Update the package lists and install required packages
RUN apt-get update && \
apt-get install -y ca-certificates curl sudo && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install Docker engine
RUN curl -fsSL https://get.docker.com -o get-docker.sh && \
sh get-docker.sh && \
rm get-docker.sh
# Install docker-compose to PATH
RUN apt install docker-compose -y
# Copy the keploy binary and the entrypoint script from the build container
COPY --from=build /app/keploy /app/keploy
COPY --from=build /app/entrypoint.sh /app/entrypoint.sh
# Make the entrypoint.sh file executable
RUN chmod +x /app/entrypoint.sh
# Change working directory (optional depending on your needs)
WORKDIR /files
# Set the entrypoint
ENTRYPOINT ["/app/entrypoint.sh", "/app/keploy"]