💡 if you got this error
Error response from daemon: cgroups: cgroup mountpoint does not exist: unknownrun those two commands:
sudo mkdir /sys/fs/cgroup/systemd
sudo mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd- Get the IP of the container
docker inspect app1 | grep AddressOR
docker container inspect [container_id] -f '{{.Address}}'- To filter the
docker inspectJSON output
docker container inspect [container_id] -f '{{.property.property}}'Useful example: to know the status of the container
docker container inspect [container_id] -f '{{.State.Status}}'- to do some system cleanup
docker system prune --all --forceDocker Volumes Three types of docker volumes 1️⃣ Host volumes
docker run -v /path/on/host:/path/on/container2️⃣ Anonymous volumes
docker run -v /path/on/container3️⃣ Named volumes (Recommended)
docker run -v name:/path/on/containerTo mount a volume to a container
1️⃣ Create a volume, and try to specify an expressive name. For example, i'll create a volume to persist mysql database data.
docker volume create mysql-volume2️⃣ Attach that volume to the mysql server container
docker run
--name mysql-with-volume
-p 3306:3306
-e MYSQL_ROOT_PASSWORD=my-secret-pass,
OTHER_EVN_VARIABLE=other_value
-d
--mount
source=mysql-volume,
target=/var/lib/mysql
mysqlUsing a bind mount We're usually using this method to sync files between the host and the container.
docker run
--name mysql-with-volume
-p 3306:3306
-e MYSQL_ROOT_PASSWORD=my-secret-pa
-d
--mount
type=bind,
source="$(pwd)/directory-you-want-to-sync
target=/var/lib/mysql
mysql- Run the oracle database from this tutorial
docker run --name oracle19c --network host -p 1521:1521 -p 5500:5500 -v /u01/oracle:/opt/oracle/oradata oracle/database:19.3.0-ee- Exec into the container
docker exec -ti oracle19c sqlplus system/oracle@orclpdb1- what linux topics to study to deeply understand docker