Skip to content

Commit dab1ac1

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 43026f1 commit dab1ac1

File tree

6 files changed

+217
-248
lines changed

6 files changed

+217
-248
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
@@ -77,31 +77,31 @@ builds:
7777
dockers:
7878
- image_templates:
7979
- "{{ .Env.IMAGE_REPO }}:{{ .Tag }}-amd64"
80-
dockerfile: Dockerfile.goreleaser
80+
dockerfile: Dockerfile
8181
use: buildx
8282
goos: linux
8383
goarch: amd64
8484
build_flag_templates:
8585
- --platform=linux/amd64
8686
- image_templates:
8787
- "{{ .Env.IMAGE_REPO }}:{{ .Tag }}-arm64"
88-
dockerfile: Dockerfile.goreleaser
88+
dockerfile: Dockerfile
8989
use: buildx
9090
goos: linux
9191
goarch: arm64
9292
build_flag_templates:
9393
- --platform=linux/arm64
9494
- image_templates:
9595
- "{{ .Env.IMAGE_REPO }}:{{ .Tag }}-ppc64le"
96-
dockerfile: Dockerfile.goreleaser
96+
dockerfile: Dockerfile
9797
use: buildx
9898
goos: linux
9999
goarch: ppc64le
100100
build_flag_templates:
101101
- --platform=linux/ppc64le
102102
- image_templates:
103103
- "{{ .Env.IMAGE_REPO }}:{{ .Tag }}-s390x"
104-
dockerfile: Dockerfile.goreleaser
104+
dockerfile: Dockerfile
105105
use: buildx
106106
goos: linux
107107
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"]

Dockerfile.goreleaser

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

0 commit comments

Comments
 (0)