めもめも

このブログに記載の内容は個人の見解であり、必ずしも所属組織の立場、戦略、意見を代表するものではありません。

Using minio server with Docker

Steps to run minio server with Docker

Since minio is still under rapid development, the following procedure may become obsolete soon... This is just a snapshot of what I've done as of writing. And I'm using CentOS7 for the docker host.

In addition, when using a KVM guest as a docker host, make sure to set vCPU to reflect host CPU config as below since minio uses Intel ISAL for storage acceleration which requires some additional CPU instructions.

Anyway, here's how you'd setup a mino server with Docker.

1. Build the minio server image and launch a container.

# docker build -t enakai00/minio:ver1.0 https://github.com/minio/minio.git
# for i in $(seq 1 4); do mkdir -p ~/disks/disk$i; done
# chcon -Rt svirt_sandbox_file_t ~/disks
# docker run -itd --name minio -p 9000:9000 -p 9001:9001 \
    -v ~/disks/disk1:/disk1 -v ~/disks/disk2:/disk2 \
    -v ~/disks/disk3:/disk3 -v ~/disks/disk4:/disk4 \
    enakai00/minio:ver1.0
# docker exec minio /go-workspace/bin/donut make donut1 /disk1 /disk2 /disk3 /disk4
# docker restart minio

2. Install client command.

# curl -L https://dl.minio.io:9000/updates/2015/Jun/linux-amd64/mc > /usr/local/bin/mc
# chmod u+x /usr/local/bin/mc
# mc config generate

3. Let's use it!

# mc mb http://localhost:9000/test
mc: Bucket created successfully : http://localhost:9000/test

# mc ls http://localhost:9000/
[2015-07-16 17:09:05 JST]     0B test/

# mc cp /etc/centos-release http://localhost:9000/test/
➩ ...ntos-release: 38 B / 38 B [=======================================] 100.00 % 3.76 KB/s 0

# mc ls http://localhost:9000/test
[2015-07-16 17:09:18 JST]    38B centos-release

# mc cat http://localhost:9000/test/centos-release
CentOS Linux release 7.1.1503 (Core) 

4. Here's what you can do with mc.

# mc -h
NAME:
  mc - Minio Client for object storage and filesystems

USAGE:
  mc [global flags] command [command flags] [arguments...]

COMMANDS:
  ls		List files and folders
  mb		Make a bucket or folder
  cat		Display contents of a file
  cp		Copy files and folders from many sources to a single destination
  sync		Copy files and folders from a single source to many destinations
  session	Start sessions for cp and sync
  diff		Compute differences between two files or folders
  access	Set access permissions
  config	Generate default configuration file [~/.mc/config.json]
  update	Check for new software updates
  
GLOBAL FLAGS:
  --quiet, -q		Suppress chatty console output
  --alias		Mimic operating system toolchain behavior wherever it makes sense
  --theme "minimal"	Choose a console theme from this list [nocolor, white, *minimal*]
  --json		Enable json formatted output
  --debug		Enable debugging output
  --version, -v		print the version
  
VERSION:
  
  Wed, 24 Jun 2015 21:56:09 GMT

Enjoy!