Stored in the hostfile system by default which is managed by Docker
Non-Docker processes are not allowed to modify
Lets create two alpine container and attach docker volume
Lets try to create a database container. docker container run -d --name mysql1 -P -e MYSQL_ROOT_PASSWORD=rootroot -e MYSQL_DATABASE=employees mysql:8
We can notice a strange volume got created
Generally while we build docker images, if there is any folder that needs to be persisted we can create the VOLUME on container creation automatically by Dockerfile DIRECTIVE called as volume
Now lets create a volume and use it while creating docker container for mysql
Create an nginx container and map 80 port of container to 8080 port of the host
Running docker in attached mode
Running docker containers in detached mode
Lets execute the pwd in the nginx container that is running
Since the container is running in the detached mode and now if you want to login into the container using some terminal (-it)
Activity 2
Create the jenkins/jenkins:latest in the attached mode and see the information. Map the port 8080 of container to any random port
Execute ctrl+C to kill the container
Now Run the jenkins/jenkins:latest in the detached mode with port 8080 mapped to any random port.
Access the application from browser and it will ask to enter some secret from a file inside container try to fetch and run that.
Lets create a volume for jenkins home dir and create a jenkins contianer
Configure jenkins and create a user
Now create a new contaier jenkins/jenkins with the same volume attached
Now delete both the containers and create the new continer with the same volume attached and login into jenkins
Lets create a standby jenkins with the max memory limit of 1GB
By default jenkins will pull out all the logs written to stdout and stderr
Activity 3
Create a postgres container with necessary volumes and insert some data and verify
Create a mongodb container with necessary volumes and insert some data and verify
what is -u in the image below
TRY to create a docker image with ubuntu as base image and default username is qtdevops (HINT: Look at USER directive in Dockerfile) and the default directory to when we execute pwd should /tmp/ (HINT: Look at WORKDIR directive in Dockerfile)