I'm impressed so far - now for Rails, Jekyll and Nginx

47 views
Skip to first unread message

Philip Rhoades P

unread,
Jul 22, 2017, 9:21:00 PM7/22/17
to rkt-dev
People,

I had a bunch of low-volume HTML, Rails and Jekyll web sites on Digital Ocean - I decided to move them back to my own server which only had a 0.9Mbit upload speed but I figured would be adequate.  Because the Rails sites were old - running on Fedora 20 x86_64, I thought it would be a good idea to turn the individual web sites into separate Docker images.  I eventually worked out how to do this but after a few weeks I noticed the Rails sites were all running deadly slow - which was confirmed by https://tools.pingdom.com .  This problem sent me off on a wild-goose chase and I was almost finished converting one of the Rails apps to another Jekyll app when I realised that the problem was Docker and NOT Nginx or Rails configs . .

The end result was that I finished the Rails -> Jekyll conversion of the app but with a lot of stuffing around, finally created another Docker container for the new Jekyll app and with multiple restarts of Docker with systmctl, I finally sorted out the weird stuff that was going on and now everything is working again - HOWEVER, this whole exercise has caused me to rethink my Docker direction for containerising old and new web sites . . I don't want to have to continually monitor a slow degradation of Docker performance . .

This was just what I needed:


- thanks!

So the next step in the investigation of rkt as a docker replacement is - could people comment about how I would do this with rkt?:

  docker run -v $(pwd):/tmp/jekyll -w "/tmp/jekyll" -p 4003:4003 irakli/jekyll jekyll s --host 0.0.0.0 -w --port 4003

Thanks,

Phil.

Mark Petrovic

unread,
Jul 23, 2017, 10:19:53 AM7/23/17
to rkt-dev

  docker run -v $(pwd):/tmp/jekyll -w "/tmp/jekyll" -p 4003:4003 irakli/jekyll jekyll s --host 0.0.0.0 -w --port 4003


Give something like this a try, though I am not familiar with --host or more than one use of -w for docker images.

rkt run --volume=jekyll,kind=host,source=$(pwd) --mount volume=jekyll,target=/tmp/jekyll --port=4003-tcp:4003 insecure-options=image --working-dir=/tmp/jekyll docker://irakli/jekyll


Stop this container with Ctrl-]]].  Start it as a systemd service by prefixing the invocation with systemd-run.
 

Mark Petrovic

unread,
Jul 23, 2017, 10:23:59 AM7/23/17
to rkt-dev
Oh, I remember now.  Arguments trailing the docker image are container arguments.  Sorry.

After the image, append 

... docker://irakli/jekyll --  --host 0.0.0.0 -w --port 4003


 

Mark Petrovic

unread,
Jul 23, 2017, 10:26:34 AM7/23/17
to rkt-dev
Need more coffee:  the --working-dir should come after the image.  See "rkt run -h".


On Sunday, July 23, 2017 at 7:19:53 AM UTC-7, Mark Petrovic wrote:

Philip Rhoades

unread,
Jul 24, 2017, 6:34:46 AM7/24/17
to Mark Petrovic, rkt-dev
Mark,

Many thanks for responding! See below:


On 2017-07-24 00:26, Mark Petrovic wrote:
> Need more coffee: the --working-dir should come after the image. See
> "rkt run -h".
>
> On Sunday, July 23, 2017 at 7:19:53 AM UTC-7, Mark Petrovic wrote:
>
>>> docker run -v $(pwd):/tmp/jekyll -w "/tmp/jekyll" -p 4003:4003
>>> irakli/jekyll jekyll s --host 0.0.0.0 -w --port 4003
>>
>> Give something like this a try, though I am not familiar with --host
>> or more than one use of -w for docker images.
>>
>> rkt run --volume=jekyll,kind=host,source=$(pwd) --mount
>> volume=jekyll,target=/tmp/jekyll --port=4003-tcp:4003
>> insecure-options=image --working-dir=/tmp/jekyll
>> docker://irakli/jekyll


# rkt run --volume=jekyll,kind=host,source=$(pwd) --mount
volume=jekyll,target=/tmp/jekyll --port=4003-tcp:4003
insecure-options=image --set-working-dir=/tmp/jekyll
docker://irakli/jekyll

run: error parsing app image arguments: unknown flag: --set-working-dir

I couldn't find a fix for the working directory and leaving it out
produced this error:

# rkt run --volume=jekyll,kind=host,source=$(pwd) --mount
volume=jekyll,target=/tmp/jekyll --port=4003-tcp:4003
insecure-options=image docker://irakli/jekyll

image: using image from local store for image name
coreos.com/rkt/stage1-host:1.11.0-1.git1ec4c60.fc25
run: ACIdentifier must contain only lower case alphanumeric characters
plus "-._~/"

Not sure about that maybe that is an artifact and something else needs
fixing?

>> Stop this container with Ctrl-]]]. Start it as a systemd service by
>> prefixing the invocation with systemd-run.


Ah, interesting! - that will be useful after I sort out the first
problems . .

Regards,

Phil.

--
Philip Rhoades

PO Box 896
Cowra NSW 2794
Australia
E-mail: ph...@pricom.com.au

Mark Petrovic

unread,
Jul 24, 2017, 8:00:20 AM7/24/17
to rkt-dev, mspet...@gmail.com, ph...@pricom.com.au


On Monday, July 24, 2017 at 3:34:46 AM UTC-7, Philip Rhoades P wrote:
Mark,

Many thanks for responding!  See below:


On 2017-07-24 00:26, Mark Petrovic wrote:
> Need more coffee:  the --working-dir should come after the image.  See
> "rkt run -h".
>
> On Sunday, July 23, 2017 at 7:19:53 AM UTC-7, Mark Petrovic wrote:
>
>>> docker run -v $(pwd):/tmp/jekyll -w "/tmp/jekyll" -p 4003:4003
>>> irakli/jekyll jekyll s --host 0.0.0.0 -w --port 4003
>>
>> Give something like this a try, though I am not familiar with --host
>> or more than one use of -w for docker images.
>>
>> rkt run --volume=jekyll,kind=host,source=$(pwd) --mount
>> volume=jekyll,target=/tmp/jekyll --port=4003-tcp:4003
>> insecure-options=image --working-dir=/tmp/jekyll
>> docker://irakli/jekyll


# rkt run --volume=jekyll,kind=host,source=$(pwd) --mount
volume=jekyll,target=/tmp/jekyll --port=4003-tcp:4003
insecure-options=image --set-working-dir=/tmp/jekyll
docker://irakli/jekyll

run: error parsing app image arguments: unknown flag: --set-working-dir

Phil, the name of this flag is --working-dir, not --set-working-dir.  

What version of rkt are you using and how did you install it?  The ACI image name warning is perplexing.  This is a good read if you have not already taken a look at it:  https://coreos.com/rkt/docs/latest/running-docker-images.html
 

Philip Rhoades

unread,
Jul 24, 2017, 8:22:42 AM7/24/17
to Mark Petrovic, rkt-dev
Mark,
Sorry - that was one of the other variations I tried - the first didn't
work either . .


> What version of rkt are you using and how did you install it?


rkt-1.11.0-1.git1ec4c60.fc25.x86_64 - an rpm . .


> The ACI
> image name warning is perplexing. This is a good read if you have not
> already taken a look at it:
> https://coreos.com/rkt/docs/latest/running-docker-images.html


OK, will check it out - thanks again!

P.
Reply all
Reply to author
Forward
0 new messages