Skip to content

Commit

Permalink
Added Dockerfiles for 3.x.x components (#4046)
Browse files Browse the repository at this point in the history
Signed-off-by: Jonsy13 <vedant.shrotria@harness.io>
  • Loading branch information
Jonsy13 committed Jun 30, 2023
1 parent 712662c commit 5ba0289
Show file tree
Hide file tree
Showing 8 changed files with 614 additions and 17 deletions.
2 changes: 1 addition & 1 deletion chaoscenter/authentication/Dockerfile
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
Expand Down
16 changes: 2 additions & 14 deletions chaoscenter/authentication/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module litmus/litmus-portal/authentication

go 1.18
go 1.20

require (
github.com/coreos/go-oidc/v3 v3.1.0
Expand All @@ -19,46 +19,34 @@ require (
)

require (
github.com/99designs/gqlgen v0.11.3 // indirect
github.com/agnivade/levenshtein v1.0.3 // indirect
github.com/aws/aws-sdk-go v1.34.28 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.13.0 // indirect
github.com/go-playground/universal-translator v0.17.0 // indirect
github.com/go-playground/validator/v10 v10.4.1 // indirect
github.com/go-stack/stack v1.8.0 // indirect
github.com/golang/snappy v0.0.1 // indirect
github.com/gorilla/websocket v1.2.0 // indirect
github.com/hashicorp/golang-lru v0.5.1 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/json-iterator/go v1.1.9 // indirect
github.com/klauspost/compress v1.9.5 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/leodido/go-urn v1.2.0 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/mitchellh/mapstructure v0.0.0-20180203102830-a4e142e9c047 // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/russross/blackfriday/v2 v2.0.1 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/ugorji/go/codec v1.1.7 // indirect
github.com/urfave/cli/v2 v2.1.1 // indirect
github.com/vektah/gqlparser/v2 v2.0.1 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.0.2 // indirect
github.com/xdg-go/stringprep v1.0.2 // indirect
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
golang.org/x/mod v0.3.0 // indirect
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 // indirect
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect
golang.org/x/text v0.3.6 // indirect
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
gopkg.in/yaml.v2 v2.2.8 // indirect
)
532 changes: 532 additions & 0 deletions chaoscenter/authentication/go.sum

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions chaoscenter/graphql/server/Dockerfile
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
2 changes: 1 addition & 1 deletion chaoscenter/graphql/server/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/litmuschaos/litmus/chaoscenter/graphql/server

go 1.18
go 1.20

require (
github.com/99designs/gqlgen v0.11.3
Expand Down
27 changes: 27 additions & 0 deletions chaoscenter/subscriber/Dockerfile
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"]
2 changes: 1 addition & 1 deletion chaoscenter/subscriber/go.mod
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
Expand Down
19 changes: 19 additions & 0 deletions chaoscenter/web/Dockerfile
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"]

0 comments on commit 5ba0289

Please sign in to comment.