diff options
| author | chrislusf <chris.lu@gmail.com> | 2015-01-01 21:23:33 -0800 |
|---|---|---|
| committer | chrislusf <chris.lu@gmail.com> | 2015-01-01 21:23:33 -0800 |
| commit | 878d1aa35e4ad1714fcb8818497f533cf2de2975 (patch) | |
| tree | 49f625ce2c85f257fdcec280e5cc9f14b0c985d4 | |
| parent | 763f5e16c7238b8e4b30ea60560212fb927a8873 (diff) | |
| parent | 3d3a81048828ed5133530f989478569ab3259d82 (diff) | |
| download | seaweedfs-878d1aa35e4ad1714fcb8818497f533cf2de2975.tar.xz seaweedfs-878d1aa35e4ad1714fcb8818497f533cf2de2975.zip | |
Merge pull request #42 from OGrape/master
Weed "minimal" docker image
| -rw-r--r-- | Dockerfile | 21 | ||||
| -rw-r--r-- | Dockerfile.go_build | 6 | ||||
| -rw-r--r-- | docs/gettingstarted.rst | 28 |
3 files changed, 51 insertions, 4 deletions
diff --git a/Dockerfile b/Dockerfile index 06d81ebf0..00b958046 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,21 @@ -FROM cydev/go -RUN go get github.com/chrislusf/weed-fs/go/weed +FROM progrium/busybox + +WORKDIR /opt/weed + +RUN opkg-install curl +RUN echo insecure >> ~/.curlrc + +RUN \ + curl -Lks https://bintray.com$(curl -Lk http://bintray.com/chrislusf/Weed-FS/seaweed/_latestVersion | grep linux_amd64.tar.gz | sed -n "/href/ s/.*href=['\"]\([^'\"]*\)['\"].*/\1/gp") | gunzip | tar -xf - -C /opt/weed/ && \ + mv weed_* bin && \ + chmod +x ./bin/weed + EXPOSE 8080 EXPOSE 9333 + VOLUME /data -ENTRYPOINT ["weed"] + +ENV WEED_HOME /opt/weed +ENV PATH ${PATH}:${WEED_HOME}/bin + +ENTRYPOINT ["weed"]
\ No newline at end of file diff --git a/Dockerfile.go_build b/Dockerfile.go_build new file mode 100644 index 000000000..8463007d1 --- /dev/null +++ b/Dockerfile.go_build @@ -0,0 +1,6 @@ +FROM cydev/go +RUN go get github.com/chrislusf/weed-fs/go/weed +EXPOSE 8080 +EXPOSE 9333 +VOLUME /data +ENTRYPOINT ["weed"]
\ No newline at end of file diff --git a/docs/gettingstarted.rst b/docs/gettingstarted.rst index ad28319fe..e0ca6f94d 100644 --- a/docs/gettingstarted.rst +++ b/docs/gettingstarted.rst @@ -82,6 +82,9 @@ Using Seaweed-FS in docker You can use image "cydev/weed" or build your own with `dockerfile <https://github.com/chrislusf/weed-fs/blob/master/Dockerfile>`_ in the root of repo. +Using pre-built Docker image +************************************************************** + .. code-block:: bash docker run --name weed cydev/weed server @@ -98,6 +101,29 @@ And in another terminal } # use $IP as host for api queries +Building image from dockerfile +************************************************************** + +Make a local copy of weed-fs from github + +.. code-block:: bash + + git clone https://github.com/chrislusf/weed-fs.git + +Minimal Image (~19.6 MB) + +.. code-block:: bash + + docker build --no-cache -t 'cydev/weed' . + +Go-Build Docker Image (~764 MB) + +.. code-block:: bash + + mv Dockerfile Dockerfile.minimal + mv Dockerfile.go_build Dockerfile + docker build --no-cache -t 'cydev/weed' . + In production ************************************************************** @@ -111,4 +137,4 @@ To gain persistency you can use docker volumes. -publicIp="$(curl -s cydev.ru/ip)" Now our weed-fs server will be persistent and accessible by localhost:9333 and :8080 on host machine. -Dont forget to specify "-publicIp" for correct connectivity.
\ No newline at end of file +Dont forget to specify "-publicIp" for correct connectivity. |
