Skip to content

Commit

Permalink
OPCT-191: Removing OCP CI image dependency on build layer (#57)
Browse files Browse the repository at this point in the history
Removing dependency on OCP CI registry images
(`registry.ci.openshift.org`) when building the project introduced on
#51
. It would be nice to unblock external contributors to use the tool when
need to build it locally.

We don't expect to fall into Docker limitations as that image should be
used in a developer environment.

https://issues.redhat.com/browse/OPCT-191

```
 $ make linux-amd64-container 
podman build -t quay.io/ocp-cert/opct:latest -f hack/Containerfile --build-arg=RELEASE_TAG=0.0.0 .
[1/2] STEP 1/5: FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.19-openshift-4.13 AS builder
Trying to pull registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.19-openshift-4.13...
Error: error creating build container: initializing source docker://registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.19-openshift-4.13: reading manifest rhel-8-golang-1.19-openshift-4.13 in registry.ci.openshift.org/ocp/builder: unauthorized: authentication required
make: *** [Makefile:49: linux-amd64-container] Error 125

```
  • Loading branch information
mtulio committed Apr 10, 2023
1 parent b0addd7 commit e690181
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ cross-build-darwin-arm64:
GOOS=darwin GOARCH=arm64 go build -o openshift-provider-cert-darwin-arm64 $(GO_BUILD_FLAGS)

.PHONY: linux-amd64-container
linux-amd64-container:
linux-amd64-container: clean
podman build -t $(IMG):latest -f hack/Containerfile --build-arg=RELEASE_TAG=$(RELEASE_TAG) .

.PHONY: test
Expand All @@ -56,8 +56,6 @@ test:
vet:
go vet ./...


.PHONY: clean
clean:
rm -rf \
openshift-provider-cert
rm -rvf ./openshift-provider-cert*
3 changes: 2 additions & 1 deletion hack/Containerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.19-openshift-4.13 AS builder
FROM docker.io/golang:1.19-alpine AS builder
ARG RELEASE_TAG
RUN apk add --no-cache --update make git
WORKDIR /go/src/github.com/redhat-openshift-ecosystem/provider-certification-tool
COPY . .
RUN make linux-amd64 RELEASE_TAG=${RELEASE_TAG}
Expand Down
2 changes: 1 addition & 1 deletion hack/Containerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ LABEL io.k8s.display-name="OPCT" \

COPY ./openshift-provider-cert-linux-amd64 /usr/bin/

CMD ["/usr/bin/opct"]
CMD ["/usr/bin/openshift-provider-cert-linux-amd64"]

0 comments on commit e690181

Please sign in to comment.