Skip to content

Commit

Permalink
Clean up Dockerfile (#439)
Browse files Browse the repository at this point in the history
* Clean up Dockerfile

Signed-off-by: John Collier <[email protected]>

* Fix base images

Signed-off-by: John Collier <[email protected]>

* Cleanup

Signed-off-by: John Collier <[email protected]>

* Update versions

Signed-off-by: John Collier <[email protected]>

* Update go deps

Signed-off-by: John Collier <[email protected]>

* Update comment

Signed-off-by: John Collier <[email protected]>

* Cleanup

Signed-off-by: John Collier <[email protected]>

* Exclude cdq-analysis from snyk

Signed-off-by: John Collier <[email protected]>

* Set build-source-image to true

Signed-off-by: John Collier <[email protected]>

---------

Signed-off-by: John Collier <[email protected]>
  • Loading branch information
johnmcollier authored Jan 24, 2024
1 parent 38527ed commit ebf7b48
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 69 deletions.
3 changes: 3 additions & 0 deletions .snyk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
exclude:
global:
- ./cdq-analysis/
2 changes: 2 additions & 0 deletions .tekton/application-service-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ spec:
value: .
- name: revision
value: '{{revision}}'
- name: build-source-image
value: 'true'
pipelineSpec:
finally:
- name: show-sbom
Expand Down
2 changes: 2 additions & 0 deletions .tekton/application-service-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ spec:
value: .
- name: revision
value: '{{revision}}'
- name: build-source-image
value: 'true'
pipelineSpec:
finally:
- name: show-sbom
Expand Down
13 changes: 9 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.19 as builder
FROM registry.access.redhat.com/ubi9/go-toolset:1.20.10 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand All @@ -21,15 +21,15 @@ COPY gitops gitops/
RUN CGO_ENABLED=0 GOOS=linux go build -a -o manager main.go

# Build the tini binary
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.6-751 as tini-builder
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9 as tini-builder
RUN microdnf update --setopt=install_weak_deps=0 -y && microdnf install git cmake make gcc gcc-c++
# build tini
RUN git clone --branch v0.19.0 https://github.com/krallin/tini /tini
WORKDIR /tini
ENV CFLAGS="-DPR_SET_CHILD_SUBREAPER=36 -DPR_GET_CHILD_SUBREAPER=37"
RUN cmake . && make tini

FROM registry.access.redhat.com/ubi8/ubi-minimal:8.6-751
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9
RUN microdnf update --setopt=install_weak_deps=0 -y && microdnf install git
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
Expand All @@ -54,5 +54,10 @@ WORKDIR /

USER 1001

ENTRYPOINT ["entrypoint.sh"]
LABEL description="RHTAP Hybrid Application Service operator"
LABEL io.k8s.description="RHTAP Hybrid Application Service operator"
LABEL io.k8s.display-name="application-service"
LABEL io.openshift.tags="rhtap"
LABEL summary="RHTAP Hybrid Application Service"

ENTRYPOINT ["entrypoint.sh"]
35 changes: 20 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/migueleliasweb/go-github-mock v0.0.19
github.com/mitchellh/go-homedir v1.1.0
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.27.8
github.com/onsi/gomega v1.27.10
github.com/openshift-pipelines/pipelines-as-code v0.0.0-20220622161720-2a6007e17200
github.com/openshift/api v0.0.0-20220912161038-458ad9ca9ca5
github.com/pact-foundation/pact-go/v2 v2.0.0-beta.23
Expand Down Expand Up @@ -43,10 +43,10 @@ require (
cloud.google.com/go/iam v1.1.1 // indirect
cloud.google.com/go/storage v1.31.0 // indirect
code.gitea.io/sdk/gitea v0.14.0 // indirect
dario.cat/mergo v1.0.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230626094100-7e9e0395ebec // indirect
github.com/acomagu/bufpipe v1.0.4 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
github.com/aws/aws-sdk-go v1.44.298 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
Expand All @@ -55,14 +55,15 @@ require (
github.com/cloudflare/circl v1.3.3 // indirect
github.com/containerd/containerd v1.6.20 // indirect
github.com/containerd/typeurl v1.0.2 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/devfile/alizer v1.2.2-0.20231004141146-f36141673c7f // indirect
github.com/devfile/registry-support/index/generator v0.0.0-20221018203505-df96d34d4273 // indirect
github.com/devfile/registry-support/registry-library v0.0.0-20221018213054-47b3ffaeadba // indirect
github.com/distribution/distribution/v3 v3.0.0-20211118083504-a29a3c99a684 // indirect
github.com/docker/cli v23.0.0-rc.1+incompatible // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/docker v23.0.0-rc.1+incompatible // indirect
github.com/docker/docker v23.0.3+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-metrics v0.0.1 // indirect
Expand All @@ -74,8 +75,8 @@ require (
github.com/fatih/color v1.14.1 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.4.1 // indirect
github.com/go-git/go-git/v5 v5.7.0 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/go-git/go-git/v5 v5.11.0 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
Expand All @@ -86,7 +87,7 @@ require (
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-github/v53 v53.0.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
Expand Down Expand Up @@ -141,7 +142,7 @@ require (
github.com/shurcooL/githubv4 v0.0.0-20190718010115-4ba037080260 // indirect
github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/skeema/knownhosts v1.1.1 // indirect
github.com/skeema/knownhosts v1.2.1 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.5.0 // indirect
Expand All @@ -153,15 +154,15 @@ require (
go.opencensus.io v0.24.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/crypto v0.16.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.10.0 // indirect
golang.org/x/tools v0.13.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/api v0.130.0 // indirect
Expand Down Expand Up @@ -191,4 +192,8 @@ require (

replace github.com/antlr/antlr4 => github.com/antlr/antlr4 v0.0.0-20211106181442-e4c1a74c66bd

replace github.com/docker/docker => github.com/docker/docker v23.0.3+incompatible

replace github.com/go-git/go-git/v5 => github.com/go-git/go-git/v5 v5.11.0

replace github.com/redhat-appstudio/application-service/cdq-analysis => ./cdq-analysis
Loading

0 comments on commit ebf7b48

Please sign in to comment.