diff --git a/images/ceph/Dockerfile.ceph b/images/ceph/Dockerfile.ceph new file mode 100644 index 000000000..0d25c7ae8 --- /dev/null +++ b/images/ceph/Dockerfile.ceph @@ -0,0 +1,16 @@ +# Copyright 2016 The Rook Authors. All rights reserved. +# +# 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 scratch +COPY ceph-install.tar / diff --git a/images/ceph/Makefile b/images/ceph/Makefile index edc3b165d..caac7c78e 100644 --- a/images/ceph/Makefile +++ b/images/ceph/Makefile @@ -46,7 +46,6 @@ CEPH_IMAGE := $(BUILD_REGISTRY)/ceph-$(CEPH_CONFIG)-$$(docker images -q $(CEPH_B IMAGES = $(CEPH_BUILDER_IMAGE) $(CEPH_IMAGE) CACHE_IMAGES = $(IMAGES) - TEMP := $(shell mktemp -d) # ==================================================================================== @@ -78,12 +77,13 @@ ceph: $(CEPH_BUILDER_IMAGE) @docker cp `cat $(TEMP)/cid`:/build/$(CEPH_TARBALL) $(TEMP)/$(CEPH_TARBALL) @docker rm -f `cat $(TEMP)/cid` - @docker import $(TEMP)/$(CEPH_TARBALL) $(CEPH_IMAGE) + @rm -fr $(TEMP)/cid +# now cache the ceph tarball in a docker image + @cp Dockerfile.ceph $(TEMP)/Dockerfile + @docker build $(BUILD_ARGS) -t $(CEPH_IMAGE) $(TEMP) @rm -fr $(TEMP) -# export the ceph tarball removing any files added by ceph that could make it -# different and result in dependent images being rebuilt %/$(CEPH_TARBALL): build @CID=`docker create $(CEPH_IMAGE) /dev/null` &&\ - docker export $$CID | tar --delete -f - .dockerenv etc dev proc sys > $@ &&\ + docker cp $$CID:$(CEPH_TARBALL) $@ &&\ docker rm -f $$CID