Container for handling data in and out of volumes.
2.6K
A container that handles data in and out of volumes.
It supports the following storage backends:
data-io supports docker secrets. It will properly source all files founds in /run/secrets/*. Each filename will become an environment variable and the contents of each respective file will become the value.
Read more about docker secrets
Export of data:
/source directory inside its own container.DATA_TAG.NO_PUSH to avoid pushing.Import of data:
DATA_TAG. Set environment variable NO_PULL to avoid pulling./.This all relies on the fact that the named volumes attached to the import and exports containers are properly configured. They should be the same volumes that are used by your application containers.
See example below.
Docker Compose example:
# reusable declarations
data:
# Use the latest and greatest
image: weahead/data-io:latest
volumes:
# We need access to Docker inside the container.
- /var/run/docker.sock:/var/run/docker.sock
environment:
# Name of the resulting image containing the data, this is what is pushed.
DATA_TAG: registry.example.com/example:latest
# OR using a private registry:
# Prefer using Docker secrets instead of environment variables here.
REGISTRY: registry.example.com
REGISTRY_USERNAME: example
REGISTRY_PASSWORD: example
DATA_TAG: example:latest
data-import:
extends:
# Reuse data service above for common properties
service: data
# Unpack command imports data
command: unpack
volumes:
# Import targets
- named-volume:/path/to/target
# Example with mysql data
- mysql-data:/var/lib/mysql
environment:
# Do not pull automatically before importing
NO_PULL: 1
data-export:
extends:
# Reuse data service above for common properties
service: data
# Pack command exports data
command: pack
volumes:
# Export targets
# Mount to /source/<path/to/import/target>, recommended read only.
- named-volume:/source/path/to/import/target:ro
# Example with mysql data
- mysql-data:/source/var/lib/mysql:ro
environment:
# Do not push automatically after creating image
NO_PUSH: 1
Export of data:
/source directory inside its own container.%Y-%m-%d_%H-%M-%S to the compressed tar balls file name.aws-cli.Import of data:
DATA_S3_DST./.This all relies on the fact that the named volumes attached to the import and exports containers are properly configured. They should be the same volumes that are used by your application containers.
See example below.
Docker Compose example:
# reusable declarations
data:
# Use the latest and greatest
image: weahead/data-io:latest
environment:
# Name of the resulting file on Amazon S3, this is what is uploaded or downloaded
DATA_S3_DST: s3://bucket-name/path/to/file.tar.gz
# AWS credentials with access to bucket specified in DATA_S3_DST
# Prefer using Docker secrets instead of environment variables here.
AWS_ACCESS_KEY_ID:
AWS_SECRET_ACCESS_KEY:
data-import:
extends:
# Reuse data service above for common properties
service: data
# Unpack command imports data
command: unpack
volumes:
# Import targets
- named-volume:/path/to/target
# Example with mysql data
- mysql-data:/var/lib/mysql
data-export:
extends:
# Reuse data service above for common properties
service: data
# Pack command exports data
command: pack
volumes:
# Export targets
# Mount to /source/<path/to/import/target>, recommended read only.
- named-volume:/source/path/to/import/target:ro
# Example with mysql data
- mysql-data:/source/var/lib/mysql:ro
Content type
Image
Digest
Size
70.4 MB
Last updated
almost 9 years ago
docker pull weahead/data-io