cassandra-docker icon indicating copy to clipboard operation
cassandra-docker copied to clipboard

please update the build instructions

Open lakamsani opened this issue 9 years ago • 8 comments

lakamsani avatar Mar 25 '15 02:03 lakamsani

+1 - for example, as a "go" newbie, I'm at a loss as to how to apply these build instructions to the concept of a go "workspace", $GOPATH, etc. Thanks!

pofallon avatar Mar 30 '15 00:03 pofallon

@tobert here is an update I made to the REAMDE.md and Dockerfile to make this go a bit smoother. Add me to this project and I can send a pull request with these changes.

@pofallon check if these work for you.

[vamsee@vamsee-mb]%git diff df5f9dcec77793e077edefea30b5e05a4be08f89..33ed7e81c7b29ed9c0058f8bf5aa0c04fa09684c diff --git a/Dockerfile b/Dockerfile index 881be0b..6bd6377 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,10 +7,7 @@ ENTRYPOINT ["/bin/cassandra-docker"] COPY install-ubuntu-packages.sh / RUN /bin/sh /install-ubuntu-packages.sh

-# TEMPORARY: while the mirrors are messed up and I'm doing -# dev passes, this will expect a tarball in the root of the repo -# wget http://www.apache.dist/cassandra/2.1.3/apache-cassandra-2.1.3-bin.tar.gz -COPY apache-cassandra-2.1.3-bin.tar.gz / +ADD http://apache.mesi.com.ar/cassandra/2.1.3/apache-cassandra-2.1.3-bin.tar.gz /

COPY install-cassandra-tarball.sh / RUN /bin/sh /install-cassandra-tarball.sh diff --git a/README.md b/README.md index 7e4bbfd..95c5881 100644 --- a/README.md +++ b/README.md @@ -87,13 +87,20 @@ are stored there for this Docker image.

Building

It's a simple process. Build the entrypoint then build the image. +For basic go install and setting GOPATH check these two pages. + +* https://golang.org/doc/install#osx +* https://golang.org/doc/code.html#GOPATH

 # get sprok and goyaml
 go get -u github.com/tobert/sprok
 go get -u gopkg.in/yaml.v2
-# build the entrypoint binary
+# build the entrypoint binary.
+cd cassandra-docker
 go build
 # build the Docker image
+# first ensure docker is running (for example via boot2docker on a Mac, or docker daemon on Linux)
 sudo docker build .
+# this could take 3-4 minutes depending on your network connection

lakamsani avatar Mar 30 '15 03:03 lakamsani

Thanks! Yes, I was able to get it to build. I suggest adding the requirement to download cassandra in advance to the build instructions in the README. Also, on a Mac it's just docker build . (no sudo required, and in fact it doesn't work with sudo). Thanks again!

pofallon avatar Apr 01 '15 12:04 pofallon

I should be able to merge everything on Friday when I sit down and publish the 2.1.4 and 2.0.14 images.

tobert avatar Apr 02 '15 05:04 tobert

@pofallon not sure why you are getting "level="fatal" msg="Error response from daemon: Cannot start container 289...: exec format error"". Seems to be running fine for me using those updated steps I sent above.

On the download of Cassandra, I was able to get the docker build command to do it as part of the container build by adding this line to Dockerfile.

+ADD http://apache.mesi.com.ar/cassandra/2.1.3/apache-cassandra-2.1.3-bin.tar.gz /

Regarding "sudo" you are right that on Mac it is not needed but might need on Linux.

lakamsani avatar Apr 02 '15 23:04 lakamsani

Thanks! I was getting 'exec format error' because I had not setup cross compiling in go, which I fixed. Now as long as I set $GOOS to 'linux' and $GOARCH to 'amd64' before compiling I don't get any errors (I don't necessarily get what I expect, but I don't get any errors).

pofallon avatar Apr 04 '15 00:04 pofallon

@pofallon did you use that to build sprok on the mac? I actually had to build it inside a container then export the binary because of the setresuid issue but I see that @tobert just fixed that on sprok two days ago.

kbowerma avatar Apr 22 '15 19:04 kbowerma

I used that to build the entrypoint for this project on a mac (part of pull request #24).

pofallon avatar Apr 22 '15 22:04 pofallon