Here I will try to put something about the issues I get during the usage of Docker images & their usage with Java application.
Please free to add your views & experiences also.
Please free to add your views & experiences also.
A great video to kick start your Docker journey.
Above is shown using MongoDB & MongoExpress & below are those commands to start your container after creating the
network.
Don't forget to create the network before executing the below commands.
Plus, you see I am using the tag/version for MongoExpress, because seems with latest verions of MongoExpress, ServerStatus section is not available. And on some internet page 0.54.0 was suggested & it worked for me also.
So this way, you can use any other version of the image also to start the container.
Above is shown using MongoDB & MongoExpress & below are those commands to start your container after creating the
network.
Don't forget to create the network before executing the below commands.
Plus, you see I am using the tag/version for MongoExpress, because seems with latest verions of MongoExpress, ServerStatus section is not available. And on some internet page 0.54.0 was suggested & it worked for me also.
So this way, you can use any other version of the image also to start the container.
Till date we are not using Docker compose so requiring to execute above scripts individually, but for now let's continue like
this & I will share the docker compose later & then we will not need to create the network explicitly as Docker compose will be
creating the default network.
But, here we see when we start the container then DB files are within container & if we remove the container then we will
loose the data & that we don't want, we want to persist the data. So we will use concept of volumes where we map the DB location in container to the host system, so even if we remove the container then we will be having the data & on starting the
new container with the same volume location, data will be loaded automatically.
Below is the sample to start the container with the volume attached to it-
this & I will share the docker compose later & then we will not need to create the network explicitly as Docker compose will be
creating the default network.
But, here we see when we start the container then DB files are within container & if we remove the container then we will
loose the data & that we don't want, we want to persist the data. So we will use concept of volumes where we map the DB location in container to the host system, so even if we remove the container then we will be having the data & on starting the
new container with the same volume location, data will be loaded automatically.
Below is the sample to start the container with the volume attached to it-
To create docker compose file from docker run command-
https://github.com/composerize/composerize
https://github.com/composerize/composerize
To inspect the container-
docker container inspect <container-id>
docker container inspect <container-id>