docker: Fix docker command entry.

master
Harshavardhana 9 years ago
parent 24ae5467c8
commit 1ef5ab3c28
  1. 10
      Docker.md
  2. 3
      Makefile
  3. 6
      README.md
  4. 6
      docker/Dockerfile
  5. 14
      docker/start.sh

@ -1,11 +1,13 @@
### Run Minio docker image ### Run Minio docker image
```docker run -p 9000:9000 minio/minio```
This will start minio server in the docker container, the data however is not persistent. Start docker, however image is not persistent.
```bash
docker run -p 9000:9000 minio/minio fs /export/data
```
### Map data volumes from host
Map export and configuration directories from host for persistence. Map export and configuration directories from host for persistence.
```bash ```bash
docker run -p 9000:9000 -v $HOME/export:/export -v $HOME/.minio:/root/.minio minio/minio docker run -p 9000:9000 --name minio1 -v /mnt/export/minio1:/export -v /mnt/config/minio1:/root/.minio minio/minio fs /export/data
``` ```

@ -131,7 +131,8 @@ install: gomake-all
dockerimage: checkdocker verifiers $(UI_ASSETS) dockerimage: checkdocker verifiers $(UI_ASSETS)
@echo "Building docker image:" minio:$(TAG) @echo "Building docker image:" minio:$(TAG)
@GO15VENDOREXPERIMENT=1 GOOS=linux GOARCH=amd64 go build --ldflags $(DOCKER_LDFLAGS) -o minio.dockerimage @GO15VENDOREXPERIMENT=1 GOOS=linux GOARCH=amd64 go build --ldflags $(DOCKER_LDFLAGS) -o docker/minio.dockerimage
@cd docker
@mkdir -p export @mkdir -p export
@sudo docker build --rm --tag=minio/minio:$(TAG) . @sudo docker build --rm --tag=minio/minio:$(TAG) .
@rmdir export @rmdir export

@ -2,7 +2,6 @@
Minio is an object storage server compatible with Amazon S3 and licensed under [Apache license 2.0](./LICENSE). Minio is an object storage server compatible with Amazon S3 and licensed under [Apache license 2.0](./LICENSE).
## Description ## Description
Minio is an open source object storage server released under Apache License V2. It is compatible with Amazon S3 cloud storage service. Minio follows a minimalist design philosophy. Minio is an open source object storage server released under Apache License V2. It is compatible with Amazon S3 cloud storage service. Minio follows a minimalist design philosophy.
@ -84,11 +83,12 @@ $ make
### How to use Minio? ### How to use Minio?
Initialize minio server at `~/Photos`
~~~ ~~~
$ minio init ~/Photos $ minio init fs ~/Photos
~~~ ~~~
#### Start Minio server. After successfully initializing, start minio server.
~~~ ~~~
$ minio server $ minio server

@ -1,8 +1,8 @@
# use "make dockerimage" to build # use "make dockerimage" to build
FROM alpine:3.3 FROM alpine:3.3
RUN apk add --no-cache ca-certificates RUN apk add --no-cache ca-certificates bash
ADD minio.dockerimage /minio ADD minio.dockerimage /minio
ADD export /export ADD export /export
EXPOSE 9000 EXPOSE 9000
ENTRYPOINT ["/minio"] COPY start.sh /start.sh
CMD ["server", "/export"] ENTRYPOINT ["/start.sh"]

@ -0,0 +1,14 @@
#!/bin/bash
if [ "$1" = 'fs' ]; then
if [ -z "$2" ]; then
echo "Invalid arguments"
echo "Usage: fs <export_dir>"
exit 1
else
/bin/mkdir -p "$2" && /minio init fs "$2" && /minio server
fi
else
echo "Usage: fs <export_dir>"
exit 0
fi
Loading…
Cancel
Save