docker-shared-services icon indicating copy to clipboard operation
docker-shared-services copied to clipboard

[Feature]: Research if `mkcert` can be used through Docker container

Open lotyp opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe.

Currently, user has to install mkcert binary on his system.

Describe the solution you'd like

To automate setup process, we could use mkcert that is packed inside Docker container.

Example: https://hub.docker.com/r/vishnunair/docker-mkcert

Describe alternatives you've considered

Currently, user has to install mkcert using brew install mkcert nss or use Linux package manager to get mkcert binary.

Additional context

Check https://hub.docker.com/r/vishnunair/docker-mkcert for more information, on how others achieve SSL certs on host system.

lotyp avatar Jun 03 '24 20:06 lotyp

I’m using my own dockerised version of mkcert.sh, and it works well (although I’ve only tested it on macOS). 🔗 https://gist.github.com/alecoletti/bfe7fde3ae2eae7480afe821e92cb20c

There’s also an updated version of the Makefile to make things smoother and adds this snippet:


setup-dns: ## Set up custom DNS resolver for .docker domains on macOS
	@if [ "$(shell uname)" = "Darwin" ]; then \
		echo "[Info] Setting up custom DNS resolver for .docker domains on macOS..."; \
		sudo sh -c 'mkdir -p /etc/resolver; echo "nameserver 127.0.0.1\nport 5053" > /etc/resolver/docker; dscacheutil -flushcache; killall -HUP mDNSResponder'; \
		echo "[Info] Custom DNS resolver for .docker domains configured on port 5053."; \
		echo "You can check with: scutil --dns"; \
	else \
		echo "[Info] DNS resolver setup is only required on macOS. Skipping."; \
	fi
.PHONY: setup-dns

setup: setup-dns
	bash mkcert.sh
.PHONY: setup

alecoletti avatar Jun 29 '25 12:06 alecoletti