Created
December 9, 2019 16:32
-
-
Save goooseman/659fa29ef4f2ec34dcd69171140cf61e to your computer and use it in GitHub Desktop.
A Dockerfile to build a Docker image with kubectl and kops. Hosted at trucknet/kops
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Taken from https://github.com/kubernetes/kops | |
# Copyright 2017 The Kubernetes Authors. | |
# | |
# 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 alpine:3.6 | |
# KUBECTL_SOURCE: Change to kubernetes-dev/ci for CI | |
ARG KUBECTL_SOURCE=kubernetes-release/release | |
# KUBECTL_TRACK: Currently latest from KUBECTL_SOURCE. Change to latest-1.3.txt, etc. if desired. | |
ARG KUBECTL_TRACK=stable.txt | |
ARG KUBECTL_ARCH=linux/amd64 | |
RUN apk add --no-cache --update ca-certificates vim curl jq && \ | |
KOPS_URL=$(curl -s https://api.github.com/repos/kubernetes/kops/releases/latest | jq -r ".assets[] | select(.name == \"kops-linux-amd64\") | .browser_download_url") && \ | |
curl -SsL --retry 5 "${KOPS_URL}" > /usr/local/bin/kops && \ | |
chmod +x /usr/local/bin/kops && \ | |
KUBECTL_VERSION=$(curl -SsL --retry 5 "https://storage.googleapis.com/${KUBECTL_SOURCE}/${KUBECTL_TRACK}") && \ | |
curl -SsL --retry 5 "https://storage.googleapis.com/${KUBECTL_SOURCE}/${KUBECTL_VERSION}/bin/${KUBECTL_ARCH}/kubectl" > /usr/local/bin/kubectl && \ | |
chmod +x /usr/local/bin/kubectl &&\ | |
apk del curl jq | |
ENTRYPOINT ["/usr/local/bin/kops"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment