Skip to content

Commit

Permalink
Build image for our purpose
Browse files Browse the repository at this point in the history
Signed-off-by: Kai Fink <[email protected]>
  • Loading branch information
4ch3los committed Sep 25, 2024
1 parent 1c8957b commit 2146d0d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
stages:
- build-docker

build-image:
stage: build-docker
variables:
# Additional options for Kaniko executor.
# For more details see https://github.com/GoogleContainerTools/kaniko/blob/master/README.md#additional-flags
KANIKO_ARGS: ""
KANIKO_BUILD_CONTEXT: $CI_PROJECT_DIR
VERSION: "1.0.0"
CI_REGISTRY: "registry.sva-cloud.com"
CI_REGISTRY_IMAGE: "argocd/argocd-vault-plugin"
image:
# For latest releases see https://github.com/GoogleContainerTools/kaniko/releases
# Only debug/*-debug versions of the Kaniko image are known to work within Gitlab CI
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- '[ $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH ] && export VERSION=latest'
- mkdir -p /kaniko/.docker
# Write credentials to access Gitlab Container Registry within the runner/ci
- echo "$DOCKER_AUTH_CONFIG" > /kaniko/.docker/config.json
# Build and push the container. To disable push add --no-push
- /kaniko/executor --context $KANIKO_BUILD_CONTEXT --dockerfile Dockerfile.sva --destination $CI_REGISTRY/$CI_REGISTRY_IMAGE:$VERSION $KANIKO_ARGS
18 changes: 18 additions & 0 deletions Dockerfile.sva
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM index.docker.io/golang:1.21 AS builder

WORKDIR '/build'

COPY . .


RUN go mod download
RUN make build

FROM alpine

RUN wget -O /usr/local/bin/gomplate https://github.com/hairyhenderson/gomplate/releases/download/v4.1.0/gomplate_linux-amd64
RUN chmod +x /usr/local/bin/gomplate
COPY --from=builder /build/argocd-vault-plugin /usr/local/bin/argocd-vault-plugin


ENTRYPOINT ["/bin/sh"]

0 comments on commit 2146d0d

Please sign in to comment.