File tree 11 files changed +22
-77
lines changed
11 files changed +22
-77
lines changed Original file line number Diff line number Diff line change 1
1
target
2
2
work
3
- demo /snapshot-plugins /
4
3
.idea
5
4
* .iml
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ snapshot-plugins /
2
+ certs /
Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ RUN /usr/local/maven/bin/mvn -s settings.xml -Dmaven.repo.local=/usr/share/jenki
37
37
COPY plugins.txt /tmp/files/
38
38
RUN /usr/local/bin/plugins.sh /tmp/files/plugins.txt
39
39
40
+ # Remove the base workflow-demo "cd" job
41
+ RUN rm -rf /usr/share/jenkins/ref/jobs/cd
42
+
40
43
ADD JENKINS_HOME /usr/share/jenkins/ref
41
44
42
45
COPY run-demo.sh /usr/local/bin/run-demo.sh
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ FROM registry:2.5.1
2
+ ADD certs/ca.crt certs/ca.key certs/docker-registry.htpasswd /var/registry/certs/
3
+ ENV REGISTRY_HTTP_TLS_CERTIFICATE /var/registry/certs/ca.crt
4
+ ENV REGISTRY_HTTP_TLS_KEY /var/registry/certs/ca.key
5
+ ENV REGISTRY_AUTH htpasswd
6
+ ENV REGISTRY_AUTH_HTPASSWD_REALM Registry Realm
7
+ ENV REGISTRY_AUTH_HTPASSWD_PATH /var/registry/certs/docker-registry.htpasswd
Original file line number Diff line number Diff line change 10
10
<scope >GLOBAL</scope >
11
11
<id >docker-registry-login</id >
12
12
<description ></description >
13
- <username >workflowuser </username >
13
+ <username >pipelineuser </username >
14
14
<password >123123123</password >
15
15
</com .cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl>
16
16
</java .util.concurrent.CopyOnWriteArrayList>
Original file line number Diff line number Diff line change 25
25
TAG =$(shell perl -n -e 'if (/docker-workflow:(.+) /) {print $$1}' plugins.txt)
26
26
IMAGE =jenkinsci/docker-workflow-demo
27
27
28
- build-proxy :
29
- docker build -t nginx:docker-workflow-demo -f Dockerfile-proxy .
28
+ build-registry :
29
+ ./gen-security-data.sh certs
30
+ docker build -t registry:docker-workflow-demo -f Dockerfile-registry .
30
31
31
32
# Builds a demo based on a released version of the plugin.
32
- build : build-proxy
33
+ build : build-registry
33
34
docker build -t $(IMAGE ) :$(TAG ) .
34
35
35
36
# Builds a demo based on the current local snapshot build of the plugin.
@@ -55,7 +56,7 @@ run-snapshot: build-snapshot
55
56
$(DOCKER_RUN ) $(IMAGE ) :SNAPSHOT
56
57
57
58
clean :
58
- rm -rf snapshot-plugins
59
+ rm -rf certs snapshot-plugins
59
60
60
61
push :
61
62
docker push $(IMAGE ) :$(TAG )
Original file line number Diff line number Diff line change @@ -31,26 +31,9 @@ mkdir -p $1
31
31
32
32
pushd $1
33
33
34
- htpasswd -bmc docker-registry.htpasswd workflowuser 123123123
34
+ docker run --entrypoint htpasswd registry:2.5.1 -Bbn pipelineuser 123123123 > docker-registry.htpasswd
35
35
36
36
# Create the CA Key and Certificate for signing Certs
37
37
openssl genrsa -des3 -passout pass:x -out ca.key 4096
38
38
openssl rsa -passin pass:x -in ca.key -out ca.key # remove password!
39
- openssl req -new -x509 -days 365 -key ca.key -out ca.crt -subj " /C=US/ST=California/L=San Jose/O=Jenkins CI/OU=Workflow Dept/CN=localhost"
40
-
41
- # Create the Server Key, CSR, and Certificate
42
- openssl genrsa -des3 -passout pass:x -out key.pem 1024
43
- openssl rsa -passin pass:x -in key.pem -out key.pem # remove password!
44
- openssl req -new -key key.pem -out server.csr -subj " /C=US/ST=California/L=San Jose/O=Jenkins CI/OU=Workflow Dept/CN=localhost"
45
-
46
- # Self sign the server cert.
47
- openssl x509 -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out cert.pem
48
-
49
- # cat the ca cert onto the server cert
50
- cat ca.crt >> cert.pem
51
-
52
- # White-list the CA cert (because it is self-signed), otherwise docker client will not be able to authenticate
53
- cp ca.crt /usr/local/share/ca-certificates
54
- update-ca-certificates
55
-
56
- popd
39
+ openssl req -new -x509 -days 365 -key ca.key -out ca.crt -subj " /C=US/ST=California/L=San Jose/O=Jenkins CI/OU=Pipeline Dept/CN=localhost"
Original file line number Diff line number Diff line change 31
31
echo ' *************** Installing a local Docker Registry Service for the demo ***************'
32
32
echo ' *************** Please sit tight for a minute ***************'
33
33
34
- cont1=$( docker run -d --name registry --restart=always registry:0.9.1)
35
- cont2=$( docker run -d -p 443:443 --name wf-registry-proxy --link registry:registry nginx:docker-workflow-demo)
34
+ cont1=$( docker run -d -p 443:5000 --name registry --restart=always registry:docker-workflow-demo)
36
35
# TODO would be natural to switch to Compose
37
- trap " docker rm -f $cont1 $cont2 " EXIT
36
+ trap " docker rm -f $cont1 " EXIT
38
37
39
38
# Note that this https://github.com/docker/docker/issues/23177 workaround is useless since the Docker CLI does not do the hostname resolution, the server does:
40
39
# echo $(docker inspect -f '{{.NetworkSettings.Gateway}}' $HOSTNAME) docker.example.com >> /etc/hosts
@@ -44,11 +43,6 @@ echo '*************** Docker Registry Service running now **
44
43
# In case some tagged images were left over from a previous run using a cache:
45
44
(docker images -q examplecorp/spring-petclinic; docker images -q localhost/examplecorp/spring-petclinic) | xargs docker rmi --no-prune=true --force
46
45
47
- #
48
- # Remove the base workflow-demo "cd" job
49
- #
50
- rm -rf /usr/share/jenkins/ref/jobs/cd /var/jenkins_home/jobs/cd
51
-
52
46
#
53
47
# Now run Jenkins.
54
48
#
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments