Skip to content

🌱 cleanup: build #3280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 0 additions & 17 deletions .github/workflows/build.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/sanity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ jobs:
- name: Run linting checks
uses: "golangci/golangci-lint-action@v6"
with:
version: "v1.55.2"
version: "v1.58.2"
skip-pkg-cache: true

19 changes: 12 additions & 7 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
run:
timeout: 8m
skip-dirs:
- pkg/lib
- pkg/api
- pkg/fakes
- pkg/package-server/apis
- test/e2e

linters:
enable:
Expand All @@ -21,6 +15,11 @@ linters:
- errcheck

linters-settings:
# This stanza is needed to avoid getting the warning
# WARN [config_reader] The configuration option `linters.errcheck.ignore` is deprecated, please use `linters.errcheck.exclude-functions`.
errcheck:
ignore: ''

importas:
alias:
- pkg: k8s.io/api/core/v1
Expand All @@ -41,7 +40,13 @@ linters-settings:
issues:
max-issues-per-linter: 0
max-same-issues: 0
exclude-dirs:
- pkg/lib
- pkg/api
- pkg/fakes
- pkg/package-server/apis
- test/e2e

output:
format: tab
formats: tab
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in this file are to fix warnings given by the tool

sort-results: true
8 changes: 4 additions & 4 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,31 +94,31 @@ builds:
dockers:
- image_templates:
- "{{ .Env.IMAGE_REPO }}:{{ .Tag }}-amd64"
dockerfile: Dockerfile.goreleaser
dockerfile: Dockerfile
use: buildx
goos: linux
goarch: amd64
build_flag_templates:
- --platform=linux/amd64
- image_templates:
- "{{ .Env.IMAGE_REPO }}:{{ .Tag }}-arm64"
dockerfile: Dockerfile.goreleaser
dockerfile: Dockerfile
use: buildx
goos: linux
goarch: arm64
build_flag_templates:
- --platform=linux/arm64
- image_templates:
- "{{ .Env.IMAGE_REPO }}:{{ .Tag }}-ppc64le"
dockerfile: Dockerfile.goreleaser
dockerfile: Dockerfile
use: buildx
goos: linux
goarch: ppc64le
build_flag_templates:
- --platform=linux/ppc64le
- image_templates:
- "{{ .Env.IMAGE_REPO }}:{{ .Tag }}-s390x"
dockerfile: Dockerfile.goreleaser
dockerfile: Dockerfile
use: buildx
goos: linux
goarch: s390x
Expand Down
41 changes: 8 additions & 33 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,15 @@
FROM quay.io/fedora/fedora:37-x86_64 as builder
LABEL stage=builder
WORKDIR /build

# install dependencies and go 1.22

# copy just enough of the git repo to parse HEAD, used to record version in OLM binaries
RUN dnf update -y && dnf install -y bash make git mercurial jq wget && dnf upgrade -y
RUN curl -sSL https://go.dev/dl/go1.22.2.linux-amd64.tar.gz | tar -xzf - -C /usr/local
ENV PATH=/usr/local/go/bin:$PATH
COPY .git/HEAD .git/HEAD
COPY .git/refs/heads/. .git/refs/heads
RUN mkdir -p .git/objects
COPY Makefile Makefile
COPY OLM_VERSION OLM_VERSION
COPY pkg pkg
COPY vendor vendor
COPY go.mod go.mod
COPY go.sum go.sum
COPY cmd cmd
COPY util util
COPY test test
RUN CGO_ENABLED=0 make build
RUN make build-util

# use debug tag to keep a shell around for backwards compatibility with the previous alpine image
FROM gcr.io/distroless/static:debug
LABEL stage=olm
WORKDIR /
# bundle unpack Jobs require cp at /bin/cp
RUN ["/busybox/ln", "-s", "/busybox/cp", "/bin/cp"]
COPY --from=builder /build/bin/olm /bin/olm
COPY --from=builder /build/bin/catalog /bin/catalog
COPY --from=builder /build/bin/package-server /bin/package-server
COPY --from=builder /build/bin/cpb /bin/cpb
COPY --from=builder /build/bin/copy-content /bin/copy-content
USER 1001
# copy goreleaser built binaries
COPY olm /bin/olm
COPY catalog /bin/catalog
COPY package-server /bin/package-server
COPY copy-content /bin/copy-content
COPY cpb /bin/cpb
EXPOSE 8080
EXPOSE 5443
CMD ["/bin/olm"]
USER 1001
ENTRYPOINT ["/bin/olm"]
Loading
Loading