Closed snim2 closed 9 years ago
@snim2 – I was using this Dockerfile recently and it has some directives in there that might be of use, specifically the COPY
and WORKDIR
ones?
We'll also need to test this out on OS X (where Docker isn't as simple) which I can hopefully look into tonight/this weekend.
Interesting, I was planning to use ADD
.
@snim2 – To be super clear here - I've not set up Docker before so please don't think I'm telling you what to use!
OK, pushed some plausible changes, but likely won't have time to properly test this until next week.
I can build this on my OSX laptop, but when I try to run it, I can't connect to port 4000.
Can somebody else on OSX (@doismellburning, @ghickman?) give this a go?
@inglesp Are you sure you're connecting to the right IP? boot2docker
uses a Vagrant box to run the Docker daemon - you don't want localhost:4000
you want $vagrantip:4000
- check $DOCKER_HOST
@inglesp – boot2docker ip
will give you the external IP of the docker instance. I couldn't get it to resolve under any of localhost:4000
, dockerip:4000
of dockerip
. I tried telling jekyll to serve on the external IP by adding -H 0.0.0.0
to the ENTRYPOINT
section but it didn't seem to do anything.
@inglesp Oh sorry, I should have checked the Dockerfile
- it's still missing --host 0.0.0.0
So I lifted https://gist.github.com/doismellburning/60c97b2e688b92e6eba3 from another project, which may be of interest? It uses a few more intermediary layers for caching goodness, and doesn't duplicate the Gemfile
(Want me to PR it this way?)
(Also don't forget the port forward; try something like docker build -t pyconukorg . && docker run -p 4000:4000 -ti pyconukorg
)
I've tested out @doismellburning's Dockerfile locally and it all seems to be working for me.
One thing to note - we could serve the site at port 80 by changing the port mapping to 80:4000
.
I've tested this with @doismellburning's Dockerfile, and it half works... I can run jekyll inside docker which builds the site, and I can access the site from my browser, but any changes to I make to the code are not reflected when I refresh the site until I restart the docker container.
In order to fix this, I've updated the Dockerfile (see https://gist.github.com/inglesp/08e5113f20124de0f3f2). You'll then need to run docker run -p 80:4000 -v $(pwd):/opt/pyconuk/site:rw -ti pyconuk.org
.
I'm terribly sorry for ever starting the trend of contribution-via-gist
Meta question: what's the right way :tm: to do this kind of collaboration?
TBH probably multiple PRs - I was concerned it might seem rude though if I rocked up with my own totally distinct PR, but actually, turning up with a gist was probably worse, sorry :s
So, do you just want to close this PR and start another one?
Hi,
I've been trying to get this to work by following the instructions at #26. Several observations:
:-(
I propose we all:
Build with 'docker build .' and run with something like 'sudo docker run -ti a16d7681862b -p 4000:4000'
Still needs more work, and some documentation in the README