-
Notifications
You must be signed in to change notification settings - Fork 687
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Dockerfiles for 3.x.x components (#4046)
Signed-off-by: Jonsy13 <vedant.shrotria@harness.io>
- Loading branch information
Showing
8 changed files
with
614 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# BUILD STAGE | ||
FROM golang:1.18 AS builder | ||
FROM golang:1.20 AS builder | ||
|
||
ARG TARGETOS=linux | ||
ARG TARGETARCH | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# BUILD STAGE | ||
FROM golang:1.20 AS builder | ||
|
||
LABEL maintainer="LitmusChaos" | ||
|
||
ARG TARGETOS=linux | ||
ARG TARGETARCH | ||
|
||
COPY . /gql-server | ||
WORKDIR /gql-server | ||
|
||
ENV GOOS=${TARGETOS} \ | ||
GOARCH=${TARGETARCH} | ||
|
||
RUN go env | ||
RUN CGO_ENABLED=0 go build -o /output/server -v | ||
|
||
## DEPLOY STAGE | ||
# Image source: https://github.com/litmuschaos/test-tools/blob/master/custom/hardened-alpine/infra/Dockerfile | ||
# The base image is non-root (have litmus user) with default litmus directory. | ||
FROM litmuschaos/infra-alpine | ||
|
||
LABEL maintainer="LitmusChaos" | ||
|
||
COPY --from=builder /output/server /litmus | ||
# Copy manifests and change the group to 0(root) to make it Openshift friendly | ||
# as Openshift runs container with an arbitrary uid that in the root group | ||
COPY --chown=litmus:0 --chmod=750 ./manifests/. /litmus/manifests | ||
CMD ["./server"] | ||
|
||
EXPOSE 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# BUILD STAGE | ||
FROM golang:1.20 AS builder | ||
|
||
LABEL maintainer="LitmusChaos" | ||
|
||
ARG TARGETOS=linux | ||
ARG TARGETARCH | ||
|
||
ADD . /subscriber | ||
WORKDIR /subscriber | ||
|
||
ENV GOOS=${TARGETOS} \ | ||
GOARCH=${TARGETARCH} | ||
|
||
RUN go env | ||
RUN CGO_ENABLED=0 go build -o /output/subscriber -v | ||
|
||
# Packaging stage | ||
# Image source: https://github.com/litmuschaos/test-tools/blob/master/custom/hardened-alpine/infra/Dockerfile | ||
# The base image is non-root (have litmus user) with default litmus directory. | ||
FROM litmuschaos/infra-alpine | ||
|
||
LABEL maintainer="LitmusChaos" | ||
|
||
COPY --from=builder /output/subscriber /litmus | ||
|
||
CMD ["./subscriber"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module subscriber | ||
|
||
go 1.18 | ||
go 1.20 | ||
|
||
require ( | ||
github.com/argoproj/argo-workflows/v3 v3.3.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7 | ||
RUN microdnf module enable nginx:1.20 | ||
RUN microdnf install nginx | ||
|
||
COPY dist /opt/chaos | ||
COPY nginx/nginx.conf /etc/nginx/ | ||
COPY ./entrypoint.sh /opt | ||
|
||
WORKDIR /opt/chaos | ||
|
||
RUN chown 65534:65534 -R /opt/chaos | ||
RUN chown 65534:65534 -R /var/log/nginx | ||
RUN chown 65534:65534 -R /etc/nginx | ||
|
||
USER 65534 | ||
|
||
EXPOSE 8184 | ||
|
||
ENTRYPOINT ["sh", "/opt/entrypoint.sh"] |