Skip to content

Instantly share code, notes, and snippets.

@mickep76 mickep76/Dockerfile
Last active Mar 1, 2018

Embed
What would you like to do?
Build boot2docker ISO with custom CA certificate for private docker registry
FROM boot2docker/boot2docker
ENV REGISTRY docker-registry
ENV DOMAIN example.com
ENV PORT 8080
# Install CA certificate
RUN mkdir -p $ROOTFS/etc/docker/certs.d/${REGISTRY}:${PORT} ;\
mkdir -p $ROOTFS/etc/docker/certs.d/${REGISTRY}.${DOMAIN}:${PORT}
COPY ca.crt $ROOTFS/etc/docker/certs.d/${REGISTRY}:${PORT}/ca.crt
COPY ca.crt $ROOTFS/etc/docker/certs.d/${REGISTRY}.${DOMAIN}:${PORT}/ca.crt
RUN mkdir -p $ROOTFS/usr/local/share/ca-certificates/${DOMAIN}
COPY ca.crt $ROOTFS/usr/local/share/ca-certificates/${DOMAIN}/ca.crt
RUN echo "cat /usr/local/share/ca-certificates/${DOMAIN}/ca.crt >> /usr/local/etc/ssl/certs/ca-certificates.crt" >> $ROOTFS/etc/init.d/rcS
# Install custom motd
COPY motd $ROOTFS/etc/motd
RUN /make_iso.sh
CMD ["cat", "boot2docker.iso"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.