From e778d047401253451abe7480a37f0f3a3c1aa224 Mon Sep 17 00:00:00 2001 From: Sam Ng Date: Thu, 1 Jan 2015 14:25:59 -0700 Subject: [PATCH 1/4] An extremely small 19.6 MB docker image for weed-fs --- Dockerfile | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 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 From 329c5915fe18a2fd48de5512a51cec31d029ad64 Mon Sep 17 00:00:00 2001 From: Sam Ng Date: Thu, 1 Jan 2015 18:56:51 -0700 Subject: [PATCH 2/4] Go Build Dockerfile --- Dockerfile.go_build | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Dockerfile.go_build 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 From b51282ae95ade0e77eecb38b3f18246a7800d014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=96=E3=83=89=E3=82=A6=E3=81=AE=E9=B3=A5?= Date: Thu, 1 Jan 2015 20:59:56 -0700 Subject: [PATCH 3/4] Update gettingstarted.rst Adding instructions to build docker image --- docs/gettingstarted.rst | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/gettingstarted.rst b/docs/gettingstarted.rst index ad28319fe..21672b811 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 `_ 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 --rm -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 --rm -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. From 3d3a81048828ed5133530f989478569ab3259d82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=96=E3=83=89=E3=82=A6=E3=81=AE=E9=B3=A5?= Date: Thu, 1 Jan 2015 21:52:42 -0700 Subject: [PATCH 4/4] Update gettingstarted.rst --- docs/gettingstarted.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/gettingstarted.rst b/docs/gettingstarted.rst index 21672b811..e0ca6f94d 100644 --- a/docs/gettingstarted.rst +++ b/docs/gettingstarted.rst @@ -114,7 +114,7 @@ Minimal Image (~19.6 MB) .. code-block:: bash - docker build --no-cache --rm -t 'cydev/weed' . + docker build --no-cache -t 'cydev/weed' . Go-Build Docker Image (~764 MB) @@ -122,7 +122,7 @@ Go-Build Docker Image (~764 MB) mv Dockerfile Dockerfile.minimal mv Dockerfile.go_build Dockerfile - docker build --no-cache --rm -t 'cydev/weed' . + docker build --no-cache -t 'cydev/weed' . In production **************************************************************