balena-os / meta-balena

A collection of Yocto layers used to build balenaOS images
https://www.balena.io/os
971 stars 116 forks source link

Add --insecure-registry list property to balena engine systemd unit #2570

Open klutchell opened 2 years ago

klutchell commented 2 years ago

This would allow connecting to local insecure registries for local development, by just using a systemd drop-in unit file.

https://docs.docker.com/registry/insecure/#deploy-a-plain-http-registry https://docs.docker.com/engine/reference/commandline/dockerd/

Adding something like this to the environment list and including the new var on the ExecStart line would be enough.

Environment=BALENAD_INSECURE_REGISTRY=

https://github.com/balena-os/meta-balena/blob/master/meta-balena-common/recipes-containers/balena/balena/balena.service

Then a drop-in file could look like

[Service]
Environment=BALENAD_INSECURE_REGISTRY=--insecure-registry=192.168.1.100
jellyfish-bot commented 2 years ago

[klutchell] This issue has attached support thread https://jel.ly.fish/585178f9-e6f3-4a3d-8f17-1df23022509f

cywang117 commented 2 years ago

Since this is for local development, wouldn't editing /etc/docker/daemon.json to include insecure-registries be easier?

klutchell commented 2 years ago

Since this is for local development, wouldn't editing /etc/docker/daemon.json to include insecure-registries be easier?

@cywang117 But then we have two methods to configure the daemon and if there are conflicts it's hard to tell which is taking priority.

jellyfish-bot commented 2 years ago

[cywang117] This has attached https://jel.ly.fish/8c141b0b-8feb-425c-98a8-07d0707a0c6e

cywang117 commented 2 years ago

@klutchell That makes sense!