From 1111e53a12cbc9747dc56788dd0ce3f5f066bb56 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sat, 28 Nov 2015 11:18:47 -0800 Subject: [PATCH] Fix docker.md with data volume container --- Docker.md | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/Docker.md b/Docker.md index d62d032fb..48caa5b30 100644 --- a/Docker.md +++ b/Docker.md @@ -1,16 +1,32 @@ -# docker run +## Running Minio in Docker. -To run docker image: -```docker run -p 9000:9000 minio/minio:latest``` +### Installing Docker. -This will start minio server in the docker container, the data however is not persistent. -If you need persistent storage you can use the command: +```bash +sudo apt-get install Docker.io +``` -```docker run -p 9000:9000 -v ${HOME}/.minio:/.minio -v ${HOME}/export:/export minio:latest``` +### Generating `minio configs` for the first time. -Here the data uploaded to the minio server will be persisted to ${HOME}/export directory. +```bash +docker run -p 9000:9000 minio/minio:latest +``` -# docker build +### Persist `minio configs`. -To build the docker image: -```make dockerimage TAG=""``` +```bash +docker commit minio/my-minio +docker stop +``` + +### Create a data volume container. + +```bash +docker create -v /export --name minio-export minio/my-minio /bin/true +``` + +You can then use the `--volumes-from` flag to mount the `/export` volume in another container. + +```bash +docker run -p 9000:9000 --volumes-from minio-export --name minio1 minio/my-minio +```