[scl.org] rhscl dockerfiles

David Martin davmarti at redhat.com
Fri Aug 7 09:07:29 UTC 2015

Thanks Tomas.

Maybe my problem wasn't explained clearly enough. Apologies.

I like to use a base nodejs image that behaves more like the one available
on docker hub https://hub.docker.com/_/node/
as opposed to one that requires the sti tools.

e.g. I can use a Dockerfile like this to build a container for my app

FROM nodejs
ADD . /usr/src/app

then do a `docker build` and I have my image for my app.

On Fri, Aug 7, 2015 at 7:38 AM, Tomas Hrcka <thrcka at redhat.com> wrote:

> On 08/06/2015 05:08 PM, Honza Horak wrote:
>> Adding Tomas into CC, he maintains nodejs and has better knowledge what
>> it means to run nodejs app.
>> My nodejs-unexperienced thought would be you can create a new docker
>> image, that will use `FROM: nodejs-010-rhel7` and:
>> * add the app code somewhere into the image (e.g. into /opt/app-root/app)
>> * changing CMD to run your application on pure `docker run`
>> Or, theoretically, you don't have to create a new layer (image), just use
>> volume mounting to get your app into the container. It would mean to run
>> the image this way:
>> #> docker run -v /your/app:/opt/app-root/app nodej-010-rhel7
>> /opt/app-root/app/run.sh
>> But I may be also wrong about how it is the best to do it. Or whether
>> this way is something we should or shouldn't recommend.
>> Sharing also to the ML, maybe others might have different opinions/ideas
>> or at least issues.
>> Honza
>> On 08/06/2015 03:42 PM, David Martin wrote:
>>> If there's a recommended way to use the sti nodejs image for simply
>>> running a node app, that'd be great.
>>> I'll spend some time trying to figure it out as I can't find Usage docs
>>> other than doing an sti build.
> Hi David,
> what I did when testing sti-nodejs, was that I have build sti-base[1] from
> scratch for rhel7. You will end up with openshift/base-rhel7
> build sti-nodejs afterwards you will have openshift/nodejs-010-rhel7 in
> you local images list. Now you are ready to build&run your nodejs
> application image with sti, like explained in usage[3].
> <snip>
> [1] - https://github.com/openshift/sti-base
> [2] - https://github.com/openshift/sti-nodejs
> [3] -
> https://github.com/openshift/sti-nodejs/blob/master/0.10/.sti/bin/usage
> --
> Tomas Hrcka
> Software Engineer - Developer Experience
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/sclorg/attachments/20150807/9dcf44ba/attachment.htm>

More information about the SCLorg mailing list