Home Explore Blog CI



docker

2nd chunk of `content/get-started/docker-concepts/the-basics/what-is-a-container.md`
1d11c6e00b268071e7df9c5d9e7efc95dd1b657f815e54630000000100000df0
Use the following instructions to run a container.

1. Open Docker Desktop and select the **Search** field on the top navigation bar.

2. Specify `welcome-to-docker` in the search input and then select the **Pull** button.

    ![A screenshot of the Docker Desktop Dashboard showing the search result for welcome-to-docker Docker image ](/Users/baehyunsol/Documents/Rust/ragit/sample/docker/content/get-started/docker-concepts/the-basics/images/search-the-docker-image.webp?border=true&w=1000&h=700)

3. Once the image is successfully pulled, select the **Run** button.

4. Expand the **Optional settings**.

5. In the **Container name**, specify `welcome-to-docker`.

6. In the **Host port**, specify `8080`.

    ![A screenshot of Docker Desktop Dashboard showing the container run dialog with welcome-to-docker typed in as the container name and 8080 specified as the port number](/Users/baehyunsol/Documents/Rust/ragit/sample/docker/content/get-started/docker-concepts/the-basics/images/run-a-new-container.webp?border=true&w=550&h=400)

7. Select **Run** to start your container.

Congratulations! You just ran your first container! 🎉
 
### View your container

You can view all of your containers by going to the **Containers** view of the Docker Desktop Dashboard.

![Screenshot of the container view of the Docker Desktop GUI showing the welcome-to-docker container running on the host port 8080](/Users/baehyunsol/Documents/Rust/ragit/sample/docker/content/get-started/docker-concepts/the-basics/images/view-your-containers.webp?border=true&w=750&h=600)

This container runs a web server that displays a simple website. When working with more complex projects, you'll run different parts in different containers. For example, you might run a different container for the frontend, backend, and database.

### Access the frontend

When you launched the container, you exposed one of the container's ports onto your machine. Think of this as creating configuration to let you to connect through the isolated environment of the container. 

For this container, the frontend is accessible on port `8080`. To open the website, select the link in the **Port(s)** column of your container or visit [http://localhost:8080](http://localhost:8080) in your browser.

![Screenshot of the landing page coming from the running container](/Users/baehyunsol/Documents/Rust/ragit/sample/docker/content/get-started/docker-concepts/the-basics/images/access-the-frontend.webp?border)

### Explore your container

Docker Desktop lets you explore and interact with different aspects of your container. Try it out yourself. 

1. Go to the **Containers** view in the Docker Desktop Dashboard.

2. Select your container.

3. Select the **Files** tab to explore your container's isolated file system.

    ![Screenshot of the Docker Desktop Dashboard showing the files and directories inside a running container](/Users/baehyunsol/Documents/Rust/ragit/sample/docker/content/get-started/docker-concepts/the-basics/images/explore-your-container.webp?border)

### Stop your container

The `docker/welcome-to-docker` container continues to run until you stop it. 

1. Go to the **Containers** view in the Docker Desktop Dashboard.

2. Locate the container you'd like to stop.

3. Select the **Stop** action in the **Actions** column.

    ![Screenshot of the Docker Desktop Dashboard with the welcome container selected and being prepared to stop](/Users/baehyunsol/Documents/Rust/ragit/sample/docker/content/get-started/docker-concepts/the-basics/images/stop-your-container.webp?border)

Title: Running and Interacting with a Docker Container
Summary
This section provides a step-by-step guide on running a Docker container using the Docker Desktop GUI, from pulling the 'welcome-to-docker' image to configuring and starting the container. It explains how to access the container's frontend through port 8080, explore the container's file system, and stop the running container via the Docker Desktop Dashboard.