Skip to content

Commit 147b0c6

Browse files
author
Per Goncalves da Silva
committed
refactor Makefile
Refactor Makefile clean up build targets Signed-off-by: Per Goncalves da Silva <[email protected]>
1 parent a9084b5 commit 147b0c6

File tree

5 files changed

+221
-234
lines changed

5 files changed

+221
-234
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.goreleaser.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,31 +94,31 @@ builds:
9494
dockers:
9595
- image_templates:
9696
- "{{ .Env.IMAGE_REPO }}:{{ .Tag }}-amd64"
97-
dockerfile: Dockerfile.goreleaser
97+
dockerfile: Dockerfile
9898
use: buildx
9999
goos: linux
100100
goarch: amd64
101101
build_flag_templates:
102102
- --platform=linux/amd64
103103
- image_templates:
104104
- "{{ .Env.IMAGE_REPO }}:{{ .Tag }}-arm64"
105-
dockerfile: Dockerfile.goreleaser
105+
dockerfile: Dockerfile
106106
use: buildx
107107
goos: linux
108108
goarch: arm64
109109
build_flag_templates:
110110
- --platform=linux/arm64
111111
- image_templates:
112112
- "{{ .Env.IMAGE_REPO }}:{{ .Tag }}-ppc64le"
113-
dockerfile: Dockerfile.goreleaser
113+
dockerfile: Dockerfile
114114
use: buildx
115115
goos: linux
116116
goarch: ppc64le
117117
build_flag_templates:
118118
- --platform=linux/ppc64le
119119
- image_templates:
120120
- "{{ .Env.IMAGE_REPO }}:{{ .Tag }}-s390x"
121-
dockerfile: Dockerfile.goreleaser
121+
dockerfile: Dockerfile
122122
use: buildx
123123
goos: linux
124124
goarch: s390x

Dockerfile

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,15 @@
1-
FROM quay.io/fedora/fedora:37-x86_64 as builder
2-
LABEL stage=builder
3-
WORKDIR /build
4-
5-
# install dependencies and go 1.22
6-
7-
# copy just enough of the git repo to parse HEAD, used to record version in OLM binaries
8-
RUN dnf update -y && dnf install -y bash make git mercurial jq wget && dnf upgrade -y
9-
RUN curl -sSL https://go.dev/dl/go1.22.2.linux-amd64.tar.gz | tar -xzf - -C /usr/local
10-
ENV PATH=/usr/local/go/bin:$PATH
11-
COPY .git/HEAD .git/HEAD
12-
COPY .git/refs/heads/. .git/refs/heads
13-
RUN mkdir -p .git/objects
14-
COPY Makefile Makefile
15-
COPY OLM_VERSION OLM_VERSION
16-
COPY pkg pkg
17-
COPY vendor vendor
18-
COPY go.mod go.mod
19-
COPY go.sum go.sum
20-
COPY cmd cmd
21-
COPY util util
22-
COPY test test
23-
RUN CGO_ENABLED=0 make build
24-
RUN make build-util
25-
26-
# use debug tag to keep a shell around for backwards compatibility with the previous alpine image
271
FROM gcr.io/distroless/static:debug
282
LABEL stage=olm
293
WORKDIR /
304
# bundle unpack Jobs require cp at /bin/cp
315
RUN ["/busybox/ln", "-s", "/busybox/cp", "/bin/cp"]
32-
COPY --from=builder /build/bin/olm /bin/olm
33-
COPY --from=builder /build/bin/catalog /bin/catalog
34-
COPY --from=builder /build/bin/package-server /bin/package-server
35-
COPY --from=builder /build/bin/cpb /bin/cpb
36-
COPY --from=builder /build/bin/copy-content /bin/copy-content
37-
USER 1001
6+
# copy goreleaser built binaries
7+
COPY olm /bin/olm
8+
COPY catalog /bin/catalog
9+
COPY package-server /bin/package-server
10+
COPY copy-content /bin/copy-content
11+
COPY cpb /bin/cpb
3812
EXPOSE 8080
3913
EXPOSE 5443
40-
CMD ["/bin/olm"]
14+
USER 1001
15+
ENTRYPOINT ["/bin/olm"]

0 commit comments

Comments
 (0)