Along with that we also need to pass a few parameters as follows. In the above command, we call the run method on docker that will create a running instance of an existing docker image. To run the docker image for PostgreSQL, you can use the following command.ĭocker run –name pgsql-dev -e POSTGRES_PASSWORD=Welcome4$ -p 5432:5432 Postgres In other words, a container is a running instance of a Docker image. When we run a Docker image, a new container is created for that image. Now, that the image is installed, the next step would be to run this image. Once the docker image has been pulled to the local machine, you can check all installed images on your local by the following command.įigure 4 – Checking installed images on localĪs you can see in the above figure, the PostgreSQL image has been installed on your machine. To pull the image to your local, you can run the following command on the terminal.įigure 3 – Pulling the PostgreSQL Docker image on local The official PostgreSQL Docker image can be found on the Docker Hub. You can pull images from the Docker hub and can also publish your images to the Docker hub. Docker images are hosted on a repository on the cloud known as the Docker hub. Now, we are good to start pulling the PostgreSQL Docker image to our local machine. You can remove your existing images by using the following command on the terminal. It is important to note that there should be no active installation of the PostgreSQL Docker image or else you need to remove it before proceeding further. You can check all the images that are installed on the Docker by using the following command.įigure 2 – List all installed Docker Images Once Docker has been successfully installed, you can check it on the terminal by using the following command. Please refer to the installation procedure and follow along. In my previous article, How to set up and run SQL Server Docker image, I have talked about installing Docker on a local machine. During deployment, you need to just run the docker image on the production environment, and all the configurations will be in from the image. You can bundle your applications into docker images that will already store the necessary configurations required to run the application. In addition to PostgreSQL, we will also install PgAmin4 using Docker, which can be used to administer the PostgreSQL instance with Docker.ĭocker is an open-source containerized application technology using which you can deploy your applications easily on-premises or on the cloud. This article will introduce you to the basic concepts of installing and using Docker on a Mac and then pulling a PostgreSQL Docker image from the Docker Hub repository. With the rise in containerization technologies, PostgreSQL can now also be installed using Docker.ĭocker is a popular application that enables users to bundle applications into containers that help in the easy deployment of resources. PostgreSQL can be installed on any operating system like Windows, macOS, and Linux. It is highly stable and has a large community that maintains and supports the database development lifecycle. PostgreSQL is one of the most popular open-source databases that is being used by a lot of developers. In this article, we will learn how to get started using PostgreSQL on Docker.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |