From 0f096ac99246ec9a08eb8f16981497a606ce0b07 Mon Sep 17 00:00:00 2001 From: TommyLike Date: Wed, 3 Jul 2019 15:56:34 +0800 Subject: [PATCH] Create base image for admission service --- Makefile | 3 ++ installer/dockerfile/admission/Dockerfile | 14 ++-------- .../dockerfile/admission/Dockerfile.base | 28 +++++++++++++++++++ 3 files changed, 34 insertions(+), 11 deletions(-) create mode 100644 installer/dockerfile/admission/Dockerfile.base diff --git a/Makefile b/Makefile index 9e8f72a336..30912510e0 100644 --- a/Makefile +++ b/Makefile @@ -44,6 +44,9 @@ images: image_bins rm installer/dockerfile/$$name/vk-$$name; \ done +admission-base-image: + docker build --no-cache -t $(IMAGE_PREFIX)-admission-base:$(TAG) ./installer/dockerfile/admission/ -f ./installer/dockerfile/admission/Dockerfile.base; + generate-code: ./hack/update-gencode.sh diff --git a/installer/dockerfile/admission/Dockerfile b/installer/dockerfile/admission/Dockerfile index c275ae5015..876c5c12c7 100644 --- a/installer/dockerfile/admission/Dockerfile +++ b/installer/dockerfile/admission/Dockerfile @@ -13,17 +13,9 @@ # limitations under the License. -FROM alpine:latest - -# Install requirements -ARG KUBE_VERSION="1.13.1" -RUN apk add --update ca-certificates && \ - apk add --update openssl && \ - apk add --update -t deps curl && \ - curl -L https://storage.googleapis.com/kubernetes-release/release/v$KUBE_VERSION/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl && \ - chmod +x /usr/local/bin/kubectl && \ - apk del --purge deps && \ - rm /var/cache/apk/* +# The base image is created via `Dockerfile.base`, the base image is cached +# since the required packages change very rarely. +FROM volcanosh/vk-admission-base:latest ADD vk-admission /vk-admission ADD gen-admission-secret.sh /gen-admission-secret.sh diff --git a/installer/dockerfile/admission/Dockerfile.base b/installer/dockerfile/admission/Dockerfile.base new file mode 100644 index 0000000000..5abbb6ce46 --- /dev/null +++ b/installer/dockerfile/admission/Dockerfile.base @@ -0,0 +1,28 @@ +# Copyright 2019 The Volcano 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:latest + +# Install requirements for admission service +# Install requirements +ARG KUBE_VERSION="1.13.1" +RUN apk add --update ca-certificates && \ + apk add --update openssl && \ + apk add --update -t deps curl && \ + curl -L https://storage.googleapis.com/kubernetes-release/release/v$KUBE_VERSION/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl && \ + chmod +x /usr/local/bin/kubectl && \ + apk del --purge deps && \ + rm /var/cache/apk/* +ENTRYPOINT []