Last active
March 18, 2016 11:46
-
-
Save miminar/352abcd3fe9a1078e0ca to your computer and use it in GitHub Desktop.
Hack and test ose-docker-registry faster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd $ORIGIN_WSP | |
go build -o /var/tmp/dockerregistry/dockerregistry ./cmd/dockerregistry | |
cd /var/tmp/dockerbuild | |
docker build -t miminarnb.vm:5002/openshift3/docker-registry:latest . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo '{"kind":"ServiceAccount","apiVersion":"v1","metadata":{"name":"registry"}}' | oc create -f - | |
oc get -o yaml scc privileged | sed '$ a\ | |
- system:serviceaccount:default:registry' | oc replace -f - | |
oadm registry --service-account=registry --config=/etc/origin/master/admin.kubeconfig --credentials=/etc/origin/master/openshift-registry.kubeconfig '--images=miminarnb.vm:5002/openshift3/docker-registry:latest' | |
oc get dc/docker-registry -o yaml | sed 's/\(imagePullPolicy:\).*/\1 IfNotPresent/' | oc replace -f - | |
oc volume dc/docker-registry --overwrite --add --name distribution --path /var/tmp/dockerregistry -m /dockerregistry -t hostPath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM miminarnb.vm:5002/openshift3/ose-docker-registry:latest | |
RUN mkdir /dockerregistry || : | |
COPY dockerregistry /dockerregistry/dockerregistry | |
VOLUME /distribution | |
CMD [ "/bin/sh", "-c", "DOCKER_REGISTRY_URL=${DOCKER_REGISTRY_SERVICE_HOST}:${DOCKER_REGISTRY_SERVICE_PORT} /dockerregistry/dockerregistry ${REGISTRY_CONFIGURATION_PATH}" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd $ORIGIN_WSP | |
go build -o /var/tmp/dockerregistry/dockerregistry ./cmd/dockerregistry && oc scale --replicas=0 dc/docker-registry && oc scale --replicas=1 dc/docker-registry |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Init
Dockerfile
to/var/tmp/dockerregistry/Dockerfile
. Change theFROM
line to match any docker-registry base image.build-the-registry-image-from-Dockerfile.sh
redeploy-on-any-registry-code-change.sh
Usage
redeploy-on-any-registry-code-change.sh