Public Repository

Last pushed: 2 months ago
Short Description
MinFS Docker Volume plugin
Full Description

MinFS Docker Volume plugin

MinFS can also be used via the MinFS Docker volume plugin. You can mount a local folder onto a Docker container, without having to go through the dependency installation or the mount and unmount operations of MinFS.

Minimum Requirements

Using Docker Compose

Use docker-compose to create a volume using the plugin and share the volume with other containers. In the example below the volume is created using the minfs plugin and and used by nginx container to serve the static content from the bucket.

version: '2'
services:
  my-test-server:
    image: nginx
    ports:
      - "80:80"
    volumes:
      - my-test-store:/usr/share/nginx/html:ro

volumes:
  my-test-store:
    driver: minio/minfs
    driver_opts:
      endpoint: https://play.minio.io:9000
      access-key: Q3AM3UQ867SPQQA43P2F
      secret-key: zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG
      bucket: testbucket

Please change the endpoint, access-key, secret-key and bucket for your local Minio setup.

Once you have successfully created docker-compose.yml configuration in your current working directory.

docker-compose up

Using Docker

One can even manually install the plugin, create and the volume using docker.

Install the plugin

docker plugin install minio/minfs

Create a docker volume my-test-store using minio/minfs driver.

docker volume create -d minio/minfs \
  --name my-test-store \
  -o endpoint=https://play.minio.io:9000 \
  -o access-key=Q3AM3UQ867SPQQA43P2F \
  -o secret-key=zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG \
  -o bucket=testbucket

Please change the endpoint, access-key, secret-key and bucket for your local Minio setup.

Once you have successfully created the volume, start a new container with my-test-store attached.
In the example below nginx container is run to serve pages from the new volume.

docker run -d --name my-test-server -p 80:80 -v my-test-store:/usr/share/nginx/html:ro nginx

Test nginx Service

Either of the above steps create a MinFS based volume for a Nginx container. Verify if your nginx container is running properly and serving content.

curl localhost
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
  body {
   width: 35em;
   margin: 0 auto;
   font-family: Tahoma, Verdana, Arial, sans-serif;
  }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>
Docker Pull Command
Owner
minio

Comments (0)