Docker Containers and Data IO - BKJackson/BKJackson_Wiki GitHub Wiki
Mounting data storage locations
Define named volume with host mount in the docker compose file - example of how to specify .env variables in docker-compose.yml files
Customize your MySQL Database in Docker - Creating Docker images and using bind mounts to customize your MySQL database, Mar 30, 2018
Creating and mounting a data volume container
Copy a file from a running container to the host
Can use containerId or containername
docker cp <containerId>:/file/path/within/container /host/path/target
Copy files from a host to the running container
Single file:
docker cp foo.txt mycontainer:/foo.txt
Multiple files
docker cp src/. mycontainer:/target
Example of using .env variables for mounted volumes
docker-compose.yml:
web_app_cli:
image: code4hire/dev-images:php-7.2-cli
hostname: "web_app_cli"
working_dir: ${WEB_DESTINATION_PATH}
volumes:
- ${WEB_APP_PATH}:${WEB_DESTINATION_PATH}
.env:
WEB_APP_PATH=./web/application
WEB_DESTINATION_PATH=/application
Articles on setting your environment variables
How to set environment variables for your web apps (for SECRET_KEY etc)
Add a volume to an existing docker container
Access all environment variables
import os
print(os.environ)
print(os.environ['HOME'])
print(os.environ['PATH'])
Mounting Azure blob store and SQL databases
Install PowerShell (various versions)
Mount Azure blob store
Mount an Azure file share in Azure Container Instances - Official Azure docs Nov. 2018
Mounting Azure File Share As Volumes In Azure Containers - Step By Step Demo - July 2018
Docker Volume Driver for Azure File Storage - 3 yrs old and deprecated, but has the early raw bits
Tutorial: Deploy a multi-container group using a Resource Manager template - 4/2019
Tutorial: Deploy a multi-container group using a YAML file - 4/2019
Configuring Azure Blob Storage for Integrated Docker Registry
Connecting to Azure storage emulator
Azure Storage emulator for development and testing - 8/9/2018
Connecting to Azure Storage Emulator in a Docker container from another container? - StackOverflow question - unanswered btw
Azure File - Note: Azure Files are not Azure Blobs!
Azure File Storage as a Docker Plugin Azure File is a Docker Volume Driver which uses Azure File Storage to mount file shares on the cloud to Docker containers as volumes. It uses network file sharing (SMB/CIFS protocols) capabilities of Azure File Storage.
Docker Cloudstor for Azure persistent data volumes - Cloudstor is a modern volume plugin built by Docker. It comes pre-installed and pre-configured in Docker Swarms deployed on Docker for Azure.
Mount Azure SQL database
Quickstart: Run SQL Server container images with Docker - 5/13/2019, In this quickstart, you use Docker to pull and run the SQL Server 2017 container image, mssql-server-linux. Then connect with sqlcmd to create your first database and run queries.
Configure SQL Server container images on Docker - 1/2019
Mounting directories
Mount host directory with a symbolic link inside in docker container
- In general, symlinks do not work. Use the absolute and exact paths.
-v /home/test/:/home/test -v /mnt/mountedfile:/mnt/mountedfile
Shared drives are needed for data outside of /Users
If your project is outside of the Users directory (cd ~), then you need to share the drive or location of the Dockerfile and volume you are using. If you get runtime errors indicating an application file is not found, a volume mount is denied, or a service cannot start, try enabling file or drive sharing. Volume mounting requires shared drives for projects that live outside of C:\Users (Windows) or /Users (Mac), and is required for any project on Docker Desktop for Windows that uses Linux containers. For more information, see Shared Drives on Docker Desktop for Windows, File sharing on Docker for Mac, and the general examples on how to Manage data in containers. Source