Skip to content

Commit

Permalink
Integration test insecure registry
Browse files Browse the repository at this point in the history
The integrations tests use their own registry so avoid hitting docker
hub rate limits.

This was using a self signed certificate but instead use
`--insecure-registry` to let the docker daemon use HTTP.
  • Loading branch information
djmb committed Jul 31, 2024
1 parent ec4aa45 commit 4e81137
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 10 deletions.
2 changes: 0 additions & 2 deletions test/integration/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ services:
context: docker/registry
environment:
- REGISTRY_HTTP_ADDR=0.0.0.0:4443
- REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt
- REGISTRY_HTTP_TLS_KEY=/certs/domain.key
volumes:
- shared:/shared
- registry:/var/lib/registry/
Expand Down
1 change: 0 additions & 1 deletion test/integration/docker/deployer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ COPY app_with_roles/ app_with_roles/

RUN rm -rf /root/.ssh
RUN ln -s /shared/ssh /root/.ssh
RUN mkdir -p /etc/docker/certs.d/registry:4443 && ln -s /shared/certs/domain.crt /etc/docker/certs.d/registry:4443/ca.crt

RUN git config --global user.email "deployer@example.com"
RUN git config --global user.name "Deployer"
Expand Down
2 changes: 1 addition & 1 deletion test/integration/docker/deployer/boot.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

dockerd --max-concurrent-downloads 1 &
dockerd --max-concurrent-downloads 1 --insecure-registry registry:4443 &

exec sleep infinity
2 changes: 0 additions & 2 deletions test/integration/docker/registry/boot.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/sh

while [ ! -f /certs/domain.crt ]; do sleep 1; done

exec /entrypoint.sh /etc/docker/registry/config.yml
2 changes: 0 additions & 2 deletions test/integration/docker/shared/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ RUN mkdir ssh && \
COPY registry-dns.conf .
COPY boot.sh .

RUN mkdir certs && openssl req -newkey rsa:4096 -nodes -sha256 -keyout certs/domain.key -x509 -days 365 -out certs/domain.crt -subj '/CN=registry' -extensions EXT -config registry-dns.conf

HEALTHCHECK --interval=1s CMD pgrep sleep

CMD ["./boot.sh"]
1 change: 0 additions & 1 deletion test/integration/docker/vm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ WORKDIR /work
RUN apt-get update --fix-missing && apt-get -y install openssh-client openssh-server docker.io

RUN mkdir /root/.ssh && ln -s /shared/ssh/id_rsa.pub /root/.ssh/authorized_keys
RUN mkdir -p /etc/docker/certs.d/registry:4443 && ln -s /shared/certs/domain.crt /etc/docker/certs.d/registry:4443/ca.crt

RUN echo "HOST_TOKEN=abcd" >> /etc/environment

Expand Down
2 changes: 1 addition & 1 deletion test/integration/docker/vm/boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ while [ ! -f /root/.ssh/authorized_keys ]; do echo "Waiting for ssh keys"; sleep

service ssh restart

dockerd --max-concurrent-downloads 1 &
dockerd --max-concurrent-downloads 1 --insecure-registry registry:4443 &

exec sleep infinity

0 comments on commit 4e81137

Please sign in to comment.