Add image for versioncontrol server (#1875)

* First pass at building a version server container image

* Actually adding the Dockerfile this branch

* Add entrypoint to auto create config file
This commit is contained in:
Matt Robinson 2019-05-02 17:25:04 -04:00 committed by Stefan Benten
parent becc7617a6
commit 43ae28ce2c
3 changed files with 29 additions and 2 deletions

View File

@ -146,6 +146,13 @@ uplink-image: uplink_linux_arm uplink_linux_amd64 ## Build uplink Docker image
${DOCKER_BUILD} --pull=true -t storjlabs/uplink:${TAG}${CUSTOMTAG}-arm32v6 \
--build-arg=GOARCH=arm --build-arg=DOCKER_ARCH=arm32v6 \
-f cmd/uplink/Dockerfile .
.PHONY: versioncontrol-image
versioncontrol-image: versioncontrol_linux_arm versioncontrol_linux_amd64 ## Build versioncontrol Docker image
${DOCKER_BUILD} --pull=true -t storjlabs/versioncontrol:${TAG}${CUSTOMTAG}-amd64 \
-f cmd/versioncontrol/Dockerfile .
${DOCKER_BUILD} --pull=true -t storjlabs/versioncontrol:${TAG}${CUSTOMTAG}-arm32v6 \
--build-arg=GOARCH=arm --build-arg=DOCKER_ARCH=arm32v6 \
-f cmd/versioncontrol/Dockerfile .
.PHONY: binary
binary: CUSTOMTAG = -${GOOS}-${GOARCH}
@ -197,8 +204,11 @@ certificates_%:
.PHONY: inspector_%
inspector_%:
GOOS=$(word 2, $(subst _, ,$@)) GOARCH=$(word 3, $(subst _, ,$@)) COMPONENT=inspector $(MAKE) binary
.PHONY: versioncontrol_%
versioncontrol_%:
GOOS=$(word 2, $(subst _, ,$@)) GOARCH=$(word 3, $(subst _, ,$@)) COMPONENT=versioncontrol $(MAKE) binary
COMPONENTLIST := gateway satellite storagenode uplink identity certificates inspector
COMPONENTLIST := gateway satellite storagenode uplink identity certificates inspector versioncontrol
OSARCHLIST := darwin_amd64 linux_amd64 linux_arm windows_amd64
BINARIES := $(foreach C,$(COMPONENTLIST),$(foreach O,$(OSARCHLIST),$C_$O))
.PHONY: binaries
@ -217,7 +227,7 @@ deploy: ## Update Kubernetes deployments in staging (jenkins)
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 gateway; do \
for c in satellite storagenode uplink gateway versioncontrol; do \
docker push storjlabs/$$c:${TAG}${CUSTOMTAG}-amd64 \
&& docker push storjlabs/$$c:${TAG}${CUSTOMTAG}-arm32v6 \
&& for t in ${TAG}${CUSTOMTAG} ${LATEST_TAG}; do \

View File

@ -0,0 +1,10 @@
ARG DOCKER_ARCH
FROM ${DOCKER_ARCH:-amd64}/alpine
ARG TAG
ARG GOARCH
ENV GOARCH ${GOARCH}
EXPOSE 8080
WORKDIR /app
COPY release/${TAG}/versioncontrol_linux_${GOARCH:-amd64} /app/versioncontrol
COPY cmd/versioncontrol/entrypoint /entrypoint
ENTRYPOINT ["/entrypoint"]

7
cmd/versioncontrol/entrypoint Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
if [ ! -f $HOME/.local/share/storj/versioncontrol/config.yaml ]; then
/app/versioncontrol setup
fi
exec /app/versioncontrol run