dcagatay/mkcert是将mkcert工具容器化的镜像,可用于生成自有的可信根CA证书以及指定域名的SSL证书,方便开发环境快速配置本地HTTPS服务。
docker-mkcert
https://github.com/FiloSottile/mkcert is a great tool for creating your own trusted Certificate Authority and certificates for any domain. Why not use mkcert in container?
Usage
Basic Usage
The container can be run with docker run command and create a new Root CA certificate and a single certificate for our domain list.
shdocker run --rm -it -v "$PWD/certs:/certs" dcagatay/mkcert example.com www.example.com '*.example.com'
Note: The single quotes around '*.example.com' are necessary to prevent the shell from prematurely expanding the wildcard character.
If the domain list is not given, only Root CA certificate will be created.
shdocker run --rm -it -v "$PWD/certs:/certs" dcagatay/mkcert
If a Root CA certificate exists /certs/ca directory (/certs/ca/rootCA.pem and /certs/ca/rootCA-key.pem, the certificate will be created using that Root CA certificate.
Advanced Usage
The owner of the created certificates is root user by default. If you want to change the ownership of the certificates you can provide PUID and PGID environment variables to the command.
shdocker run --rm -it -e "PUID=$(id -u)" -e "PGID=$(id -g)" -v "$PWD/certs:/certs" dcagatay/mkcert example.com www.example.com '*.example.com'
Building Image Locally
shdocker buildx build -t dcagatay/mkcert:latest .
Changelog
- In the version
v1.4.4;- The root certificate directory was moved to
/certs/cafrom/certs, If you were using a previous version you need to move yourrootCA.pemandrootCA-key.pemfiles under/certs/ca. - The user id and group id variables,
UIDandGID, are renamed toPUIDandPUID.
- The root certificate directory was moved to
Credits
- https://github.com/FiloSottile/mkcert
- Inspired by https://github.com/vishnudxb/docker-mkcert
镜像拉取方式
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
DockerHub 原生拉取命令
用户好评
来自真实用户的反馈,见证轩辕镜像的优质服务