Skip to content

Commit

Permalink
add script for releasing a Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
xrstf committed Jul 2, 2020
1 parent 95641a9 commit 523e875
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2020 The Kubermatic Kubernetes Platform contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.14-alpine as builder

WORKDIR /app/
COPY . .
RUN go build

FROM alpine:3.12

COPY --from=builder /app/boilerplate .
ENTRYPOINT ["/boilerplate"]
31 changes: 31 additions & 0 deletions hack/ci/release-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

# Copyright 2020 The Kubermatic Kubernetes Platform contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This script creates the Docker images on quay.io. Docker is not handled
# by goreleaser because of our internal CI infrastructure and separation
# of credentials.

set -euo pipefail

cd $(dirname $0)/../..

repo="quay.io/kubermatic-labs/boilerplate"
tag="$(git describe --tags --exact-match)"
image="$repo:$tag"

set -x
docker build -t "$image" .
docker push "$image"
File renamed without changes.

0 comments on commit 523e875

Please sign in to comment.