add container image for segment-reaper (#3855)

This commit is contained in:
Matt Robinson 2020-04-21 10:48:40 -04:00 committed by GitHub
parent e655e160dc
commit 1e295a48e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 2 deletions

View File

@ -154,7 +154,7 @@ storagenode-console:
gofmt -w -s storagenode/console/consoleassets/bindata.resource.go
.PHONY: images
images: satellite-image storagenode-image uplink-image versioncontrol-image ## Build satellite, storagenode, uplink, and versioncontrol Docker images
images: satellite-image segment-reaper storagenode-image uplink-image versioncontrol-image ## Build satellite, segment-reaper, storagenode, uplink, and versioncontrol Docker images
echo Built version: ${TAG}
.PHONY: satellite-image
@ -167,6 +167,18 @@ satellite-image: satellite_linux_arm satellite_linux_arm64 satellite_linux_amd64
${DOCKER_BUILD} --pull=true -t storjlabs/satellite:${TAG}${CUSTOMTAG}-aarch64 \
--build-arg=GOARCH=arm --build-arg=DOCKER_ARCH=aarch64 \
-f cmd/satellite/Dockerfile .
.PHONY: segment-reaper-image
segment-reaper-image: segment-reaper_linux_amd64 segment-reaper_linux_arm segment-reaper_linux_arm64 ## Build segment-reaper Docker image
${DOCKER_BUILD} --pull=true -t storjlabs/segment-reaper:${TAG}${CUSTOMTAG}-amd64 \
-f cmd/segment-reaper/Dockerfile .
${DOCKER_BUILD} --pull=true -t storjlabs/segment-reaper:${TAG}${CUSTOMTAG}-arm32v6 \
--build-arg=GOARCH=arm --build-arg=DOCKER_ARCH=arm32v6 \
-f cmd/segment-reaper/Dockerfile .
${DOCKER_BUILD} --pull=true -t storjlabs/segment-reaper:${TAG}${CUSTOMTAG}-aarch64 \
--build-arg=GOARCH=arm --build-arg=DOCKER_ARCH=aarch64 \
-f cmd/segment-reaper/Dockerfile .
.PHONY: storagenode-image
storagenode-image: storagenode_linux_arm storagenode_linux_arm64 storagenode_linux_amd64 ## Build storagenode Docker image
${DOCKER_BUILD} --pull=true -t storjlabs/storagenode:${TAG}${CUSTOMTAG}-amd64 \
@ -251,6 +263,9 @@ inspector_%:
.PHONY: satellite_%
satellite_%:
$(MAKE) binary-check COMPONENT=satellite GOARCH=$(word 3, $(subst _, ,$@)) GOOS=$(word 2, $(subst _, ,$@))
.PHONY: segment-reaper_%
segment-reaper_%:
$(MAKE) binary-check COMPONENT=segment-reaper GOARCH=$(word 3, $(subst _, ,$@)) GOOS=$(word 2, $(subst _, ,$@))
.PHONY: storagenode_%
storagenode_%: storagenode-console
$(MAKE) binary-check COMPONENT=storagenode GOARCH=$(word 3, $(subst _, ,$@)) GOOS=$(word 2, $(subst _, ,$@))
@ -290,7 +305,7 @@ libuplink-gomobile:
push-images: ## Push Docker images to Docker Hub (jenkins)
# images have to be pushed before a manifest can be created
# satellite
for c in satellite storagenode uplink versioncontrol ; do \
for c in satellite segment-reaper storagenode uplink versioncontrol ; do \
docker push storjlabs/$$c:${TAG}${CUSTOMTAG}-amd64 \
&& docker push storjlabs/$$c:${TAG}${CUSTOMTAG}-arm32v6 \
&& docker push storjlabs/$$c:${TAG}${CUSTOMTAG}-aarch64 \
@ -337,6 +352,7 @@ clean-images:
-docker rmi storjlabs/storagenode:${TAG}${CUSTOMTAG}
-docker rmi storjlabs/uplink:${TAG}${CUSTOMTAG}
-docker rmi storjlabs/versioncontrol:${TAG}${CUSTOMTAG}
-docker rmi storjlabs/segment-reaper:${TAG}${CUSTOMTAG}
.PHONY: test-docker-clean
test-docker-clean: ## Clean up Docker environment used in test-docker target

View File

@ -0,0 +1,9 @@
ARG DOCKER_ARCH
FROM ${DOCKER_ARCH:-amd64}/alpine
ARG TAG
ARG GOARCH
ENV GOARCH ${GOARCH}
WORKDIR /app
COPY release/${TAG}/segment-reaper_linux_${GOARCH:-amd64} /app/segment-reaper
ENTRYPOINT ["/app/segment-reaper"]