diff options
author | Clark Laughlin <clark.laughlin@linaro.org> | 2015-11-21 21:41:08 -0500 |
---|---|---|
committer | Clark Laughlin <clark.laughlin@linaro.org> | 2015-11-21 21:41:08 -0500 |
commit | 0279c87e67b086c8499ca3314cde10432c44c8a7 (patch) | |
tree | 3d1e117bf4b41044b72e57d21955f000202cd5ca | |
parent | 1abea08f55c557f0f129641fba4d130080d8a0e9 (diff) |
enable container start of registry browser
-rwxr-xr-x | build-local-images | 8 | ||||
-rw-r--r-- | config | 2 | ||||
-rwxr-xr-x | containers.d/50-registry-browser | 7 | ||||
-rw-r--r-- | registry-browser.dockerfile | 32 | ||||
-rw-r--r-- | registry-browser/server.go | 1 |
5 files changed, 48 insertions, 2 deletions
diff --git a/build-local-images b/build-local-images index 7831561..6d3f319 100755 --- a/build-local-images +++ b/build-local-images @@ -3,6 +3,14 @@ BASE=${PWD} PORTUS_SOURCE=${BASE}/portus +# build local/registry-browser +check_portus_image=$(docker images | grep local/registry-browser) +if [ ! -z "${check_portus_image}" ] ; then + docker rmi local/registry-browser +fi +pushd registry-browser +docker build --tag=local/registry-browser -f ${BASE}/registry-browser.dockerfile . + # clone SUSE/Portus if [ -d ${PORTUS_SOURCE} ]; then rm -rf ${PORTUS_SOURCE} @@ -9,4 +9,4 @@ PORTUS_IMAGE=local/portus REGISTRY_IMAGE=local/registry DOCKER_REGISTRY_VIRTUAL_HOST=docker-registry.linaro.org DOCKER_PORTUS_VIRTUAL_HOST=docker-auth.linaro.org - +DOCKER_LANDING_VIRTUAL_HOST=docker.linaro.org diff --git a/containers.d/50-registry-browser b/containers.d/50-registry-browser new file mode 100755 index 0000000..f69e1a4 --- /dev/null +++ b/containers.d/50-registry-browser @@ -0,0 +1,7 @@ +#!/bin/bash + +# start the registry browser web server container +docker run -d --name landing-site \ + --restart=unless-stopped \ + -e VIRTUAL_HOST=${DOCKER_LANDING_VIRTUAL_HOST} \ + local/registry-browser diff --git a/registry-browser.dockerfile b/registry-browser.dockerfile new file mode 100644 index 0000000..3a1cd24 --- /dev/null +++ b/registry-browser.dockerfile @@ -0,0 +1,32 @@ +FROM ubuntu:14.04 +RUN apt-get update +RUN apt-get install -y build-essential git wget curl mercurial + +RUN mkdir /goproj + +ENV GOPATH=/goproj +ENV PATH=/goproj/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + +# install golang from source +RUN wget -qO- https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz | tar -C /usr/local -xzf - + +# create gopath directories +RUN mkdir -p /goproj +RUN mkdir -p /goproj/bin +RUN mkdir -p /goproj/pkg +RUN mkdir -p /goproj/src/linaro.org/docker-registry-browser + +# get dependencies +RUN go get github.com/gorilla/mux + +# Copy the local package files to the container's workspace. +ADD . /goproj/src/linaro.org/docker-registry-browser + +WORKDIR /goproj/src/linaro.org/docker-registry-browser +RUN go install . + +# Run the golang server app when the container starts. +ENTRYPOINT /goproj/bin/docker-registry-browser -registry=https://docker-registry.linaro.org -user=portus -password=L1nar0Docker + +# Document that the service listens on port 80 +EXPOSE 80 diff --git a/registry-browser/server.go b/registry-browser/server.go index 9f9c5da..387a74b 100644 --- a/registry-browser/server.go +++ b/registry-browser/server.go @@ -17,7 +17,6 @@ import ( var ( ignoreCertErrors = flag.Bool("ignoreCertErrors", true, "Ignore certificate errors") listenAddr = flag.String("listen", ":80", "HTTP service address") - namespace = flag.String("namespace", "", "Registry namespace (if needed)") registryServer = flag.String("registry", "https://registry", "Docker registry endpoint") user = flag.String("user", "portus", "User to authenticate with the registry") password = flag.String("password", "", "Password to authenticate with the registry") |