Home Explore Blog CI



docker

4th chunk of `content/get-started/docker-concepts/running-containers/sharing-local-files.md`
eac37ace05820d7349ae34c9cb0125cdbf4116e779e0e1730000000100000d99
   {                       /  ===-
   \______ O           __/
    \    \         __/
     \____\_______/

    Hello from Docker!
    </pre>
    </body>
    </html>
    ```

4. It's time to run the container. The `--mount` and `-v` examples produce the same result. You can't run them both unless you remove the `my_site` container after running the first one.

   {{< tabs >}}
   {{< tab name="`-v`" >}}

   ```console
   $ docker run -d --name my_site -p 8080:80 -v .:/usr/local/apache2/htdocs/ httpd:2.4
   ```

   {{< /tab >}}
   {{< tab name="`--mount`" >}}

   ```console
   $ docker run -d --name my_site -p 8080:80 --mount type=bind,source=./,target=/usr/local/apache2/htdocs/ httpd:2.4
   ```

   {{< /tab >}}
   {{< /tabs >}}


   > [!TIP]  
   > When using the `-v` or `--mount` flag in Windows PowerShell, you need to provide the absolute path to your directory instead of just `./`. This is because PowerShell handles relative paths differently from bash (commonly used in Mac and Linux environments).    



   With everything now up and running, you should be able to access the site via [http://localhost:8080](http://localhost:8080) and find a new webpage that welcomes you with a friendly whale.


### Access the file on the Docker Desktop Dashboard

1. You can view the mounted files inside a container by selecting the container's **Files** tab and then selecting a file inside the `/usr/local/apache2/htdocs/` directory. Then, select **Open file editor**.


   ![A screenshot of Docker Desktop Dashboard showing the mounted files inside the a container](/Users/baehyunsol/Documents/Rust/ragit/sample/docker/content/get-started/docker-concepts/running-containers/images/mounted-files.webp?border=true)

2. Delete the file on the host and verify the file is also deleted in the container. You will find that the files no longer exist under **Files** in the Docker Desktop Dashboard.


   ![A screenshot of Docker Desktop Dashboard showing the deleted files inside the a container](/Users/baehyunsol/Documents/Rust/ragit/sample/docker/content/get-started/docker-concepts/running-containers/images/deleted-files.webp?border=true)


3. Recreate the HTML file on the host system and see that file re-appears under the **Files** tab under **Containers** on the Docker Desktop Dashboard. By now, you will be able to access the site too.



### Stop your container

The 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 **Delete** action in the Actions column.

![A screenshot of Docker Desktop Dashboard showing how to delete the container](/Users/baehyunsol/Documents/Rust/ragit/sample/docker/content/get-started/docker-concepts/running-containers/images/delete-the-container.webp?border=true)


## Additional resources

The following resources will help you learn more about bind mounts:

* [Manage data in Docker](/storage/)
* [Volumes](/storage/volumes/)
* [Bind mounts](/storage/bind-mounts/)
* [Running containers](/reference/run/)
* [Troubleshoot storage errors](/storage/troubleshooting_volume_errors/)
* [Persisting container data](/get-started/docker-concepts/running-containers/persisting-container-data/)

## Next steps

Now that you have learned about sharing local files with containers, it’s time to learn about multi-container applications.

{{< button text="Multi-container applications" url="Multi-container applications" >}}

Title: Accessing and Managing Mounted Files, Stopping Containers, and Additional Resources
Summary
This section continues the guide on using bind mounts, demonstrating how to access the mounted files within the container using the Docker Desktop Dashboard and verify that changes made on the host system are reflected inside the container and vice-versa. It also explains how to stop a running container via the Docker Desktop Dashboard. Finally, it provides a list of additional resources related to data management, volumes, bind mounts, running containers, troubleshooting storage errors, and persisting container data, as well as a link to the next steps, which involve learning about multi-container applications.