cockroachdb: rook/cockroachdb image build
Signed-off-by: Jared Watts <jbw976@gmail.com>
This commit is contained in:
6 files changed
+74
-3
No files matched your search
@@ -23,7 +23,7 @@ cd "${scriptdir}/../../vendor/k8s.io/code-generator" && ./generate-groups.sh \
|
||||
all \
|
||||
github.com/rook/rook/pkg/client \
|
||||
github.com/rook/rook/pkg/apis \
|
||||
"rook.io:v1alpha1,v1alpha2 ceph.rook.io:v1alpha1"
|
||||
"rook.io:v1alpha1,v1alpha2 ceph.rook.io:v1alpha1 cockroachdb.rook.io:v1alpha1"
|
||||
# this seems busted in the release-1.8 branch
|
||||
# --go-header-file ${SCRIPT_ROOT}/build/codegen/header.txt
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ endif
|
||||
DOCKER_REGISTRY ?= rook
|
||||
QUAY_REGISTRY ?= quay.io/rook
|
||||
REGISTRIES ?= $(DOCKER_REGISTRY) $(QUAY_REGISTRY)
|
||||
IMAGES ?= ceph ceph-toolbox
|
||||
IMAGES ?= ceph ceph-toolbox cockroachdb
|
||||
IMAGE_ARCHS := $(subst linux_,,$(filter linux_%,$(PLATFORMS)))
|
||||
IMAGE_PLATFORMS := $(subst _,/,$(subst $(SPACE),$(COMMA),$(filter linux_%,$(PLATFORMS))))
|
||||
|
||||
|
||||
@@ -66,4 +66,5 @@ Containers go to docker hub and quay.io where we have the following repos:
|
||||
```
|
||||
rook/ceph
|
||||
rook/ceph-toolbox
|
||||
rook/cockroachdb
|
||||
```
|
||||
+4
-1
@@ -35,7 +35,10 @@ ceph.%:
|
||||
ceph-toolbox.%: ceph.%
|
||||
@$(MAKE) -C ceph-toolbox PLATFORM=$*
|
||||
|
||||
do.build.images.%: ceph.% ceph-toolbox.% ;
|
||||
cockroachdb.%:
|
||||
@$(MAKE) -C cockroachdb PLATFORM=$*
|
||||
|
||||
do.build.images.%: ceph.% ceph-toolbox.% cockroachdb.% ;
|
||||
do.build: do.build.images.$(PLATFORM) ;
|
||||
build.all: $(foreach p,$(PLATFORMS), do.build.images.$(p)) ;
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
# Copyright 2018 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 cockroachdb/cockroach:v2.0.2
|
||||
|
||||
ADD rook /usr/local/bin/
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/rook"]
|
||||
CMD [""]
|
||||
Executable
+47
@@ -0,0 +1,47 @@
|
||||
# Copyright 2018 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.
|
||||
|
||||
include ../image.mk
|
||||
|
||||
# ====================================================================================
|
||||
# Image Build Options
|
||||
|
||||
COCKROACHDB_IMAGE = $(BUILD_REGISTRY)/cockroachdb-$(GOARCH)
|
||||
IMAGES = $(COCKROACHDB_IMAGE)
|
||||
|
||||
TEMP := $(shell mktemp -d)
|
||||
|
||||
# ====================================================================================
|
||||
# Build Rook CockroachDB
|
||||
|
||||
# since this is a leaf image we avoid leaving around a lot of dangling images
|
||||
# by removing the last build of the final cockroachdb image
|
||||
OLD_IMAGE_ID := $(shell docker images -q $(COCKROACHDB_IMAGE))
|
||||
CURRENT_IMAGE_ID := $$(docker images -q $(COCKROACHDB_IMAGE))
|
||||
IMAGE_FILENAME := $(IMAGE_OUTPUT_DIR)/cockroachdb.tar.gz
|
||||
|
||||
do.build:
|
||||
@echo === docker build $(COCKROACHDB_IMAGE)
|
||||
@cp Dockerfile $(TEMP)
|
||||
@cp $(OUTPUT_DIR)/bin/linux_$(GOARCH)/rook $(TEMP)
|
||||
@docker build $(BUILD_ARGS) \
|
||||
-t $(COCKROACHDB_IMAGE) \
|
||||
$(TEMP)
|
||||
@[ "$(OLD_IMAGE_ID)" != "$(CURRENT_IMAGE_ID)" ] && [ -n "$(OLD_IMAGE_ID)" ] && docker rmi $(OLD_IMAGE_ID) || true
|
||||
@if [ ! -e "$(IMAGE_FILENAME)" ] || [ "$(OLD_IMAGE_ID)" != "$(CURRENT_IMAGE_ID)" ] || [ -n "$(OLD_IMAGE_ID)" ]; then \
|
||||
echo === saving image $(COCKROACHDB_IMAGE); \
|
||||
mkdir -p $(IMAGE_OUTPUT_DIR); \
|
||||
docker save $(COCKROACHDB_IMAGE) | gzip -c > $(IMAGE_FILENAME); \
|
||||
fi
|
||||
@rm -fr $(TEMP)
|
||||
Reference in new issue
Block a user