-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathContainerfile.wasp
More file actions
39 lines (30 loc) · 878 Bytes
/
Containerfile.wasp
File metadata and controls
39 lines (30 loc) · 878 Bytes
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
# Builder stage
FROM fedora:42 as builder
# Install necessary tools for building
RUN dnf update -y && dnf install -y \
golang \
make \
git \
&& dnf clean all
# Copy the source code from the host to the container
COPY pkg /workdir/app/pkg
COPY tools /workdir/app/tools
COPY cmd /workdir/app/cmd
COPY vendor /workdir/app/vendor
COPY go.mod /workdir/app/go.mod
COPY go.sum /workdir/app/go.sum
COPY Makefile /workdir/app/Makefile
WORKDIR /workdir/app
RUN make wasp
# Final stage
FROM fedora:38
# Copy the binary from the builder stage to the final image
COPY --from=builder /workdir/app/wasp /app/wasp
COPY OCI-hook /app/OCI-hook
# Set the working directory to /app
WORKDIR /app
# Add a non-root user for running the application
RUN useradd -u 1001 -r -s /sbin/nologin -d /app/wasp wasp
USER 1001
# Set the entrypoint to the binary
ENTRYPOINT ["/app/wasp"]