Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #196 from jose-bigio/master_move_tar_targets
Browse files Browse the repository at this point in the history
[master] move tar targets
  • Loading branch information
seemethere authored Sep 11, 2018
2 parents b143f50 + 8a4744f commit 65ba360
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 36 deletions.
20 changes: 3 additions & 17 deletions deb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -155,21 +155,7 @@ sources/dockerd.json: ../common/dockerd.json
-e 's/$${IMAGE_TAG}/$(IMAGE_TAG)/' \
$< > $@

# TODO: Eventually clean this up when we release an image with a manifest
DOCKER2OCI=artifacts/docker2oci
$(DOCKER2OCI):
-$(CHOWN) -R $(shell id -u):$(shell id -g) $(@D)
docker run --name docker2oci $(GO_IMAGE) sh -c 'go get github.com/coolljt0725/docker2oci'
mkdir -p $(@D)
docker cp docker2oci:/go/bin/docker2oci "$@"
docker rm -f docker2oci
$(CHOWN) -R $(shell id -u):$(shell id -g) $(@D)

# offline bundle
sources/engine.tar: $(DOCKER2OCI)
$(MAKE) -C ../image ENGINE_IMAGE=$(ENGINE_IMAGE) ENGINE_SCOPE=$(ENGINE_SCOPE) image-linux
mkdir -p artifacts
docker save -o artifacts/docker-engine.tar $$(cat ../image/image-linux)
./$(DOCKER2OCI) -i artifacts/docker-engine.tar artifacts/engine-image
mkdir -p $(@D)
tar c -C artifacts/engine-image . > $@
sources/engine.tar:
$(MAKE) -C ../image ENGINE_IMAGE=$(ENGINE_IMAGE) ENGINE_SCOPE=$(ENGINE_SCOPE) engine-$(ARCH).tar
mv ../image/engine-$(ARCH).tar $@
17 changes: 15 additions & 2 deletions image/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ STATIC_VERSION=$(shell ../static/gen-static-ver $(ENGINE_DIR) $(VERSION))
DOCKER_HUB_ORG?=dockereng
ARCH=$(shell uname -m)
ENGINE_IMAGE?=engine-community
CHOWN:=docker run --rm -v $(CURDIR):/v -w /v alpine chown
DEFAULT_PRODUCT_LICENSE?=Community Engine

.PHONY: help
Expand Down Expand Up @@ -42,9 +43,21 @@ image-linux: $(ENGINE_DIR)/Dockerfile.engine
--file $< $(ENGINE_DIR)
echo $(DOCKER_HUB_ORG)/$(ENGINE_IMAGE):$(STATIC_VERSION).$(ARCH) > $@

engine-$(ARCH).tar: image-linux
docker save -o $@ $$(cat $<)
DOCKER2OCI=artifacts/docker2oci
$(DOCKER2OCI):
-$(CHOWN) -R $(shell id -u):$(shell id -g) $(@D)
docker run --name docker2oci $(ENGINE_GO_IMAGE) sh -c 'go get github.com/coolljt0725/docker2oci'
mkdir -p $(@D)
docker cp docker2oci:/go/bin/docker2oci "$@"
docker rm -f docker2oci
$(CHOWN) -R $(shell id -u):$(shell id -g) $(@D)

engine-$(ARCH).tar: image-linux $(DOCKER2OCI)
mkdir -p artifacts
docker save -o artifacts/docker-engine.tar $$(cat image-linux)
./$(DOCKER2OCI) -i artifacts/docker-engine.tar artifacts/engine-image
mkdir -p $(@D)
tar c -C artifacts/engine-image . > $@

.PHONY: release
release:
Expand Down
20 changes: 3 additions & 17 deletions rpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,21 +123,7 @@ rpmbuild/SOURCES/dockerd.json: ../common/dockerd.json
-e 's/$${IMAGE_TAG}/$(IMAGE_TAG)/' \
$< > $@

# TODO: Eventually clean this up when we release an image with a manifest
DOCKER2OCI=artifacts/docker2oci
$(DOCKER2OCI):
-$(CHOWN) -R $(shell id -u):$(shell id -g) $(@D)
docker run --name docker2oci $(GO_IMAGE) sh -c 'go get github.com/coolljt0725/docker2oci'
mkdir -p $(@D)
docker cp docker2oci:/go/bin/docker2oci "$@"
docker rm -f docker2oci
$(CHOWN) -R $(shell id -u):$(shell id -g) $(@D)

# offline bundle
rpmbuild/SOURCES/engine.tar: $(DOCKER2OCI)
$(MAKE) -C ../image ENGINE_IMAGE=$(ENGINE_IMAGE) ENGINE_SCOPE=$(ENGINE_SCOPE) image-linux
mkdir -p artifacts
docker save -o artifacts/docker-engine.tar $$(cat ../image/image-linux)
./$(DOCKER2OCI) -i artifacts/docker-engine.tar artifacts/engine-image
mkdir -p $(@D)
tar c -C artifacts/engine-image . > $@
rpmbuild/SOURCES/engine.tar:
$(MAKE) -C ../image ENGINE_IMAGE=$(ENGINE_IMAGE) ENGINE_SCOPE=$(ENGINE_SCOPE) engine-$(ARCH).tar
mv ../image/engine-$(ARCH).tar $@

0 comments on commit 65ba360

Please sign in to comment.