Skip to content

Commit d504028

Browse files
committed
Publish fluxctl to Docker Hub
- add fluxctl Dockerfile - add fluxctl image build and push to CircleCI release
1 parent b457efa commit d504028

File tree

3 files changed

+41
-3
lines changed

3 files changed

+41
-3
lines changed

.circleci/config.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,18 @@ jobs:
125125
docker push "docker.io/fluxcd/flux-prerelease:$(docker/image-tag)"
126126
fi
127127
- deploy:
128-
name: Maybe push release image and upload binaries
128+
name: Maybe push release images and upload binaries
129129
command: |
130130
if echo "${CIRCLE_TAG}" | grep -Eq "^[0-9]+(\.[0-9]+)*(-[a-z0-9]+)?$"; then
131131
# Publish binaries to GitHub
132132
go get github.com/weaveworks/github-release
133-
make release-bins
133+
make build-fluxctl
134134
bin/upload-binaries
135135
136-
# Publish image on DockerHub
136+
# Publish images on DockerHub
137137
echo "$DOCKER_FLUXCD_PASSWORD" | docker login --username "$DOCKER_FLUXCD_USER" --password-stdin
138138
docker push "docker.io/fluxcd/flux:${CIRCLE_TAG}"
139+
docker push "docker.io/fluxcd/fluxctl:${CIRCLE_TAG}"
139140
140141
# Republish tag with v prefix so it is available to Go Mod
141142
git config --global user.email fluxcdbot@users.noreply.github.com

Makefile

+9
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,15 @@ $(GENERATED_TEMPLATES_FILE): pkg/install/templates/*.tmpl pkg/install/generate.g
178178
check-generated: generate-deploy
179179
git diff --exit-code -- deploy/
180180

181+
build-fluxctl: release-bins
182+
mkdir -p ./build/docker/fluxctl
183+
cp ./build/fluxctl_linux_amd64 ./build/docker/fluxctl/fluxctl
184+
cp ./docker/Dockerfile.fluxctl ./build/docker/fluxctl/Dockerfile
185+
$(SUDO) docker build -t docker.io/fluxcd/fluxctl:$(IMAGE_TAG) \
186+
--build-arg VCS_REF="$(VCS_REF)" \
187+
--build-arg BUILD_DATE="$(BUILD_DATE)" \
188+
-f ./build/docker/fluxctl/Dockerfile ./build/docker/fluxctl
189+
181190
build-docs:
182191
@cd docs && docker build -t flux-docs .
183192

docker/Dockerfile.fluxctl

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM alpine:3.11
2+
3+
WORKDIR /home/flux
4+
5+
RUN apk add --no-cache openssh-client ca-certificates curl
6+
7+
COPY ./fluxctl /usr/local/bin/
8+
9+
LABEL maintainer="Flux CD <https://github.com/fluxcd/flux/issues>" \
10+
org.opencontainers.image.title="fluxctl" \
11+
org.opencontainers.image.description="Flux CLI" \
12+
org.opencontainers.image.url="https://github.com/fluxcd/flux" \
13+
org.opencontainers.image.source="git@github.com:fluxcd/flux" \
14+
org.opencontainers.image.vendor="Flux CD" \
15+
org.label-schema.schema-version="1.0" \
16+
org.label-schema.name="fluxctl" \
17+
org.label-schema.description="Flux CLI" \
18+
org.label-schema.url="https://github.com/fluxcd/flux" \
19+
org.label-schema.vcs-url="git@github.com:fluxcd/flux" \
20+
org.label-schema.vendor="Flux CD"
21+
22+
ARG BUILD_DATE
23+
ARG VCS_REF
24+
25+
LABEL org.opencontainers.image.revision="$VCS_REF" \
26+
org.opencontainers.image.created="$BUILD_DATE" \
27+
org.label-schema.vcs-ref="$VCS_REF" \
28+
org.label-schema.build-date="$BUILD_DATE"

0 commit comments

Comments
 (0)