Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Commit

Permalink
rebase (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alva8756 authored May 6, 2024
1 parent bd92c02 commit 7a75068
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,13 @@ dockers:
-
image_templates:
- "ghcr.io/metal-toolbox/{{.ProjectName}}:{{ .Tag }}"
dockerfile: Dockerfile
dockerfile: Dockerfile.goreleaser
build_flag_templates:
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--build-arg=APP_NAME={{.ProjectName}}"

sboms:
- artifacts: archive
Expand Down
18 changes: 18 additions & 0 deletions Dockerfile.goreleaser
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM golang:1.22.2-alpine3.18 AS build

ARG APP_NAME
FROM alpine:3.19.1
ARG APP_NAME
ENV APP_NAME=${APP_NAME}

RUN echo "${APP_NAME}"
RUN apk -U add curl

COPY "${APP_NAME}" /fleet/${APP_NAME}

RUN adduser -D fleet
RUN chown -R fleet:fleet /fleet

USER fleet

ENTRYPOINT "/fleet/${APP_NAME}" "$0" "$@"
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ image:
--build-arg LDFLAG_LOCATION=${LDFLAG_LOCATION} \
--build-arg GIT_COMMIT=${GIT_COMMIT} --build-arg GIT_BRANCH=${GIT_BRANCH} \
--build-arg GIT_SUMMARY=${GIT_SUMMARY} --build-arg VERSION=${VERSION} \
--build-arg BUILD_DATE=${BUILD_DATE}
--build-arg BUILD_DATE=${BUILD_DATE} \
-f Dockerfile

goreleaser-image:
docker build -t ${DOCKER_IMAGE}:latest . \
--build-arg APP_NAME=${SERVICE_NAME} \
-f Dockerfile.goreleaser

push-sandbox-image: image
docker tag ${DOCKER_IMAGE}:latest ${SANDBOX_IMAGE}:latest
Expand Down

0 comments on commit 7a75068

Please sign in to comment.