Skip to content

Latest commit

 

History

History
49 lines (35 loc) · 1001 Bytes

README.md

File metadata and controls

49 lines (35 loc) · 1001 Bytes

docker-tls

Download

curl -O https://raw.githubusercontent.com/SoraKumo001/docker-tls/master/docker-tls.sh

Usage

sudo bash docker-tls.sh
sudo bash docker-tls.sh DNS:host.example.com,IP:10.1.1.1

Create files

  • Server keys
    • /etc/docker/certs/ca.pem
    • /etc/docker/certs/server-key.pem
    • /etc/docker/certs//server-cert.pem
  • Client keys
    • ~/.docker/ca.pem
    • ~/.docker/cert.pem
    • ~/.docker/key.pem

Docker server setting

  • /lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd --tlsverify --tlscacert=/etc/docker/certs/ca.pem --tlscert=/etc/docker/certs/server-cert.pem --tlskey=/etc/docker/certs/server-key.pem -H tcp://0.0.0.0 -H fd:// --containerd=/run/containerd/containerd.sock

Restart service

sudo systemctl daemon-reload
sudo systemctl restart docker

Client command

docker --tls -H server-address ps