Difference between revisions of "Docker"

From Briki
Jump to: navigation, search
(Creating a dedicated IP for a home-assistant docker container)
(Creating a dedicated IP for a home-assistant docker container)
Line 8: Line 8:
 
== Creating a dedicated IP for a home-assistant docker container ==
 
== Creating a dedicated IP for a home-assistant docker container ==
  
   sudo docker network create -d macvlan --gateway 192.168.1.1 --subnet 192.168.1.0/24 --ip-range 192.168.1.231/29 -o eth0 homeassistant-net
+
   sudo docker network create -d macvlan --gateway 192.168.1.1 --subnet 192.168.1.0/24 --ip-range 192.168.1.231/29 -o parent=eth0 docker-subnet
   sudo docker run --init -d --name="home-assistant" -v /var/lib/homeassistant:/config -v /var/www/html/arlo-snapshots:/arlo-snapshots -v /etc/localtime:/etc/localtime:ro --net docker-subnet --ip 192.168.1.231 homeassistant/home-assistant
+
   sudo docker run --init -d --name="home-assistant" -v /var/lib/homeassistant/docker:/config -v /var/www/html/arlo-snapshots:/arlo-snapshots -v /etc/localtime:/etc/localtime:ro --net docker-subnet --ip 192.168.1.231 homeassistant/home-assistant

Revision as of 21:39, 14 March 2019

Useful Commands

docker ps -a
List all containers
docker container inspect <container>
Show details of <container>
docker logs <container>; Show logs for <container>
docker exec -it <container> /bin/bash
Start an interactive shell in <container>

Creating a dedicated IP for a home-assistant docker container

 sudo docker network create -d macvlan --gateway 192.168.1.1 --subnet 192.168.1.0/24 --ip-range 192.168.1.231/29 -o parent=eth0 docker-subnet
 sudo docker run --init -d --name="home-assistant" -v /var/lib/homeassistant/docker:/config -v /var/www/html/arlo-snapshots:/arlo-snapshots -v /etc/localtime:/etc/localtime:ro --net docker-subnet --ip 192.168.1.231 homeassistant/home-assistant