Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Publish fluxctl to Docker Hub #2915

Merged
merged 1 commit into from
Mar 19, 2020
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,18 @@ jobs:
docker push "docker.io/fluxcd/flux-prerelease:$(docker/image-tag)"
fi
- deploy:
name: Maybe push release image and upload binaries
name: Maybe push release images and upload binaries
command: |
if echo "${CIRCLE_TAG}" | grep -Eq "^[0-9]+(\.[0-9]+)*(-[a-z0-9]+)?$"; then
# Publish binaries to GitHub
go get github.com/weaveworks/github-release
make release-bins
make build-fluxctl
bin/upload-binaries

# Publish image on DockerHub
# Publish images on DockerHub
echo "$DOCKER_FLUXCD_PASSWORD" | docker login --username "$DOCKER_FLUXCD_USER" --password-stdin
docker push "docker.io/fluxcd/flux:${CIRCLE_TAG}"
docker push "docker.io/fluxcd/fluxctl:${CIRCLE_TAG}"

# Republish tag with v prefix so it is available to Go Mod
git config --global user.email [email protected]
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,15 @@ $(GENERATED_TEMPLATES_FILE): pkg/install/templates/*.tmpl pkg/install/generate.g
check-generated: generate-deploy
git diff --exit-code -- deploy/

build-fluxctl: release-bins
mkdir -p ./build/docker/fluxctl
cp ./build/fluxctl_linux_amd64 ./build/docker/fluxctl/fluxctl
cp ./docker/Dockerfile.fluxctl ./build/docker/fluxctl/Dockerfile
$(SUDO) docker build -t docker.io/fluxcd/fluxctl:$(IMAGE_TAG) \
--build-arg VCS_REF="$(VCS_REF)" \
--build-arg BUILD_DATE="$(BUILD_DATE)" \
-f ./build/docker/fluxctl/Dockerfile ./build/docker/fluxctl

build-docs:
@cd docs && docker build -t flux-docs .

Expand Down
28 changes: 28 additions & 0 deletions docker/Dockerfile.fluxctl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM alpine:3.11

WORKDIR /home/flux

RUN apk add --no-cache openssh-client ca-certificates curl

COPY ./fluxctl /usr/local/bin/

LABEL maintainer="Flux CD <https://github.com/fluxcd/flux/issues>" \
org.opencontainers.image.title="fluxctl" \
org.opencontainers.image.description="Flux CLI" \
org.opencontainers.image.url="https://github.com/fluxcd/flux" \
org.opencontainers.image.source="[email protected]:fluxcd/flux" \
org.opencontainers.image.vendor="Flux CD" \
org.label-schema.schema-version="1.0" \
org.label-schema.name="fluxctl" \
org.label-schema.description="Flux CLI" \
org.label-schema.url="https://github.com/fluxcd/flux" \
org.label-schema.vcs-url="[email protected]:fluxcd/flux" \
org.label-schema.vendor="Flux CD"

ARG BUILD_DATE
ARG VCS_REF

LABEL org.opencontainers.image.revision="$VCS_REF" \
org.opencontainers.image.created="$BUILD_DATE" \
org.label-schema.vcs-ref="$VCS_REF" \
org.label-schema.build-date="$BUILD_DATE"