# Docker



### Installation

Installer le paquet Container Manager dans DSM

[DockerHub](https://hub.docker.com/search?q=)



##### Redémarrer Container Manager

```bash
$ systemctl list-units --type=service --all | grep -i docker
  pkg-ContainerManager-dockerd.service                                  loaded    active   running Docker Application Container Engine
  pkg-ContainerManager-event-watcherd.service                           loaded    active   running Docker event watch service

```

```bash
$ sudo systemctl restart pkg-ContainerManager-dockerd
```



### Utilisation

[Mise-à-jour des containers](updates.md) (Container Manager - WatchTower)

[Ports](ports.md)

```bash
ERROR: could not find an available, non-overlapping IPv4 address pool among the defaults to assign to the network 
```

Ajouter à `/etc/docker/daemon.json` (ou le créer)

```json
{
  "default-address-pools" : [
    {
      "base" : "172.17.0.0/12",
      "size" : 20
    },
    {
      "base" : "192.168.0.0/16",
      "size" : 24
    }
  ]
}
```

Autre solution:

```yaml
networks:
  default:
    driver: bridge
    ipam:
      config:
        - subnet: 172.16.57.0/24
```

https://straz.to/2021-09-08-docker-address-pools/

https://jareklipski.medium.com/docker-can-only-create-31-default-networks-e7f98f778626

https://serverfault.com/questions/916941/configuring-docker-to-not-use-the-172-17-0-0-range

https://stackoverflow.com/questions/43720339/docker-error-could-not-find-an-available-non-overlapping-ipv4-address-pool-am

### Containers

- [iGotify](docker-compose/igotify.md)
- [Pi.Alert](docker-compose/Pi.Alert.md)
- [searXNG](docker-compose/searXNG.md)
- [WireGuard](Wireguard.md)



### Login

```bash
$ sudo docker login --username=foo

# WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
```



```bash
$ cat ~/my_password.txt | docker login --username foo --password-stdin
```

https://www.howtogeek.com/devops/how-to-login-to-docker-hub-and-private-registries-with-the-docker-cli/



### Backups

https://mariushosting.com/synology-how-to-back-up-docker-containers/

