Playground project to work with Minio Cloud Storage.
Features:
- Create a bucket & its public policy on first usage (in the APP)
- Upload files
- List uploaded files
- Persist data in a docker volume
- Docker & Docker Compose
- VirtualBox & Docker Machine for playing with a remote docker host
- Clone this project
- Install APP dependencies
- Start the containers
- Browse http://localhost/index.php
git clone https://github.com/aanton/docker-minio-demo.git docker-minio-demo
cd docker-minio-demo
Run composer locally in the app
folder:
composer install --working-dir app
docker-compose up # stop them: CTRL+C
docker-compose up -d # stop them using: docker-compose down
- Stop & remove containers & networks
- Remove uploaded files
docker-compose down
sudo find .minio -mindepth 1 -maxdepth 1 -type d -exec rm -r {} \;
- Create the virtual machine (VirtualBox is used)
- Set share folder
- Set the docker client to connect to use the remote docker host/daemon
- Clone this project in the container
- Install APP dependencies in the container
- Start the containers
- Browse http://[docker-host]/index.php
# Set the local working directory
mkdir demo-minio && cd $_
# Create virtual machine
docker-machine create -d virtualbox --virtualbox-share-folder $(pwd):$(pwd) vm1
# Get docker host IP
docker-machine ip vm1
# Set the (local) docker client to wotk with the remote docker host/daemon
eval $(docker-machine env vm1)
# Check there are no images, containers & volumes in the remote docker host/daemon
docker system df
docker run --rm \
--volume $(pwd):/git \
--user $(id -u):$(id -g) \
composer \
git clone https://github.com/aanton/docker-minio-demo.git /git
Run composer in the app
folder:
docker run --rm --interactive --tty \
--volume $(pwd)/app:/app \
--user $(id -u):$(id -g) \
composer install
- Set docker host IP (required in docker-compose.yml)
- Start the containers
export DOCKER_HOST_IP=$(docker-machine ip ${DOCKER_MACHINE_NAME:-default})
docker-compose up # stop them: CTRL+C
docker-compose up -d # stop them using: docker-compose down
- Stop & remove containers & networks
- Stop & destroy virtual machine
- Remove uploaded files
docker-compose down
docker-machine stop vm1
docker-machine rm vm1
sudo find .minio -mindepth 1 -maxdepth 1 -type d -exec rm -r {} \;