Skip to content

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
Signed-off-by: Issif <issif+github@gadz.org>
  • Loading branch information
Issif authored and poiana committed May 11, 2022
1 parent 6bb6d16 commit 74b4d86
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ linters:
include:
- EXC0002 # include "missing comments" issues from golint
max-issues-per-linter: 0
max-same-issues: 0
max-same-issues: 0

2 changes: 2 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ docker_signs:

release:
github:
owner: falcosecurity
name: falcosidekick
prerelease: auto
extra_files:
- glob: ./release/cosign.pub
16 changes: 2 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
ARG BUILDER_IMAGE=golang:1.18-buster
ARG BASE_IMAGE=alpine:3.15

FROM ${BUILDER_IMAGE} AS build-stage

ENV CGO_ENABLED=0

WORKDIR /src/
COPY . .

RUN go get
RUN make falcosidekick

# Final Docker image
FROM ${BASE_IMAGE} AS final-stage
LABEL MAINTAINER "Thomas Labarussias <issif+falcosidekick@gadz.org>"
Expand All @@ -25,8 +13,8 @@ USER 1234

WORKDIR ${HOME}/app
COPY LICENSE .
COPY --from=build-stage /src/falcosidekick .
COPY falcosidekick .

EXPOSE 2801

ENTRYPOINT ["./falcosidekick"]
ENTRYPOINT ["./falcosidekick"]
31 changes: 31 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
ARG BUILDER_IMAGE=golang:1.18-buster
ARG BASE_IMAGE=alpine:3.15

FROM ${BUILDER_IMAGE} AS build-stage

ENV CGO_ENABLED=0

WORKDIR /src/
COPY . .

RUN make falcosidekick

# Final Docker image
FROM ${BASE_IMAGE} AS final-stage
LABEL MAINTAINER "Thomas Labarussias <issif+falcosidekick@gadz.org>"

RUN apk add --update --no-cache ca-certificates

# Create user falcosidekick
RUN addgroup -S falcosidekick && adduser -u 1234 -S falcosidekick -G falcosidekick
# must be numeric to work with Pod Security Policies:
# https://kubernetes.io/docs/concepts/policy/pod-security-policy/#users-and-groups
USER 1234

WORKDIR ${HOME}/app
COPY LICENSE .
COPY --from=build-stage /src/falcosidekick .

EXPOSE 2801

ENTRYPOINT ["./falcosidekick"]
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ TOOLS_BIN_DIR := $(abspath $(TOOLS_DIR)/bin)
GO_INSTALL = ./hack/go_install.sh

# Binaries.
GOLANGCI_LINT_VER := v1.44.2
GOLANGCI_LINT_VER := v1.46.0
GOLANGCI_LINT_BIN := golangci-lint
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER)

Expand All @@ -51,15 +51,17 @@ GOLANGCI_LINT := $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER)

.PHONY: falcosidekick
falcosidekick:
$(GO) mod download
$(GO) build -trimpath -ldflags "$(LDFLAGS)" -gcflags all=-trimpath=/src -asmflags all=-trimpath=/src -a -installsuffix cgo -o $@ .

.PHONY: falcosidekick-linux-amd64
falcosidekick-linux-amd64:
$(GO) mod download
GOOS=linux GOARCH=amd64 $(GO) build -gcflags all=-trimpath=/src -asmflags all=-trimpath=/src -a -installsuffix cgo -o falcosidekick .

.PHONY: build-image
build-image: falcosidekick-linux-amd64
$(DOCKER) build . -t falcosecurity/falcosidekick:latest
$(DOCKER) build -t falcosecurity/falcosidekick:latest .

## --------------------------------------
## Test
Expand Down

0 comments on commit 74b4d86

Please sign in to comment.