turnbullpress / dockerbook-code

The code and configuration examples from The Docker Book (http://www.dockerbook.com)
929 stars 580 forks source link

jekyll container won't pick up configuration file #4

Closed dreamineering closed 10 years ago

dreamineering commented 10 years ago

I am running docker inside vagrant (phusion 14) and can't get the container to pass the right directory

I have tried altering volume to have different paths and moved contents of blog to different locations and tried various way to name inputs.

But when I look into volume directory it is empty... I must be doing something stupid but I can't see it.

docker run -v $PWD/james_blog:/data/ --name james_blog stackmates/jekyll Configuration file: none Source: /data Destination: /var/www/html Generating... done.

FROM ubuntu:14.04 MAINTAINER Matt Mischewski matt@dreamineering.com

RUN apt-get -yqq update RUN apt-get -yqq install ruby ruby-dev make nodejs RUN gem install --no-rdoc --no-ri jekyll

VOLUME [ "/data/", "/var/www/html/" ] WORKDIR /data

ENTRYPOINT [ "jekyll", "build", "--destination=/var/www/html" ]

jamtur01 commented 10 years ago

What platform are you running on? OSX?

dreamineering commented 10 years ago

Yeah is this the problem?

https://github.com/docker/docker/issues/4023

jamtur01 commented 10 years ago

Yep - there's some notes in the installation chapter around boot2docker and this limitation. Boot2Docker 1.3 fixes some of the issue.

dreamineering commented 10 years ago

I checked this out just as a sanity check and it works

https://github.com/grahamc/docker-jekyll

OK my ignorance thought because I was working ubuntu VM in vagrant this would not be an issue?

dreamineering commented 10 years ago

I've had a lot of problems with boot2docker so gave that a miss, I've upgraded to 1.3 but will go back and try with boot2docker and report back

jamtur01 commented 10 years ago

Where is the client running? Inside the vagrant VM? The issue in 4023 is generally when you're running the Docker daemon in a VM and the client locally on OSX.

dreamineering commented 10 years ago

Inside vagrant

jamtur01 commented 10 years ago

Then it's something else I think. Let me try your Dockerfile.

dreamineering commented 10 years ago

Been working through the book on a clean vagrant install of phusion 14.04

Went to dockersite to run script to upgrade to 1.3 as found exec was missing

Thing is the earlier example worked for nginx with passing in host volume

“$ sudo docker run -d -p 80 --name website \ -v $PWD/website:/var/www/html/website \ jamtur01/nginx nginx”

Wondering if it was something about way

VOLUME [ '/data', '/etc...' ] was defined?

dreamineering commented 10 years ago

ran this from docker site to upgrade ubuntu host to docker 1.3

$ curl -sSL https://get.docker.com/ubuntu/ | sudo sh

dreamineering commented 10 years ago

sorry about piecemeal info but this is the box

config.vm.box = "phusion/ubuntu-14.04-amd64"

jamtur01 commented 10 years ago

Looks like something has changed in the way volumes are being defined in JSON form. Try:

VOLUME /data VOLUME /var/www/html

in your Dockerfile and rebuild.

dreamineering commented 10 years ago

Cool thanks checking out now

dreamineering commented 10 years ago

THANK YOU

Man that was driving me insane! Thought it had to be something I was overlooking.

At least it was a good way for me to re-read over stuff :)

Cheers