forked from kubev2v/migration-planner
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile.agent
More file actions
46 lines (33 loc) · 1.16 KB
/
Copy pathContainerfile.agent
File metadata and controls
46 lines (33 loc) · 1.16 KB
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 --platform=linux/amd64 registry.access.redhat.com/ubi9/ubi as ui
RUN dnf install -y npm wget
WORKDIR /app
COPY . .
RUN mkdir /app/www && cp -r ./agent-ui/* /app/www
RUN wget -P /app/www/js https://unpkg.com/axios/dist/axios.min.js
WORKDIR /app/www
RUN npm init -y && npm install @patternfly/patternfly
RUN cp -r ./node_modules/@patternfly/patternfly/assets css/
RUN cp -r ./node_modules/@patternfly/patternfly/patternfly.css css/
# Builder container
FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/go-toolset as builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG GCFLAGS=""
ARG VERSION
ENV VERSION=${VERSION}
USER 0
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -buildvcs=false ${GCFLAGS:+-gcflags "$GCFLAGS"} \
-ldflags "-X github.com/kubev2v/migration-planner/internal/agent.version=${VERSION}" \
-o /planner-agent cmd/planner-agent/main.go
FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/ubi-minimal
WORKDIR /app
COPY --from=builder /planner-agent /app/
COPY --from=ui /app/www/ /app/www
# Use non-root user
RUN chown -R 1001:0 /app
USER 1001
# Run the server
EXPOSE 3333
ENTRYPOINT ["/app/planner-agent"]