Merge pull request #25693 from luxas/fix_hyperkube

Automatic merge from submit-queue

Fix hyperkube's layer caching, and remove --make-symlinks at build time

@david-mcmahon This is required before you release. Explanation in the code.
This commit is contained in:
k8s-merge-robot 2016-05-17 04:01:43 -07:00
commit 1738bbfe5f
2 changed files with 11 additions and 8 deletions

View File

@ -58,12 +58,7 @@ RUN mkdir -p /opt/cni
RUN curl https://storage.googleapis.com/kubernetes-release/network-plugins/cni-c864f0e1ea73719b8f4582402b0847064f9883b0.tar.gz \
| tar xzv -C /opt/cni
# Make scripts executable
RUN chmod a+rx \
/hyperkube \
/usr/share/google/safe_format_and_mount \
/setup-files.sh \
/make-ca-cert.sh
# Create symlinks for each hyperkube server
RUN /hyperkube --make-symlinks
# TODO: this is unreliable for now (e.g. running "/kubelet" panics)
# Also, it doesn't work for other architectures
# RUN /hyperkube --make-symlinks

View File

@ -55,6 +55,14 @@ endif
cd ${TEMP_DIR} && sed -i.back "s|BASEIMAGE|${BASEIMAGE}|g" Dockerfile
rm ${TEMP_DIR}/*.back
# Make scripts executable before they are copied into the Docker image. If we make them executable later, in another layer
# they'll take up twice the space because the new executable binary differs from the old one, but everything is cached in layers.
cd ${TEMP_DIR} && chmod a+rx \
hyperkube \
safe_format_and_mount \
setup-files.sh \
make-ca-cert.sh
ifeq ($(ARCH),amd64)
# When building "normally" for amd64, remove the whole line, it has no part in the amd64 image
cd ${TEMP_DIR} && sed -i "/CROSS_BUILD_/d" Dockerfile