You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Daniel McGreal <d....@gmail.com> on 2017/06/16 13:12:46 UTC

Karaf in Docker

Hi Karaf users,
I’m trying to run Karaf in Docker using mkroli/karaf.
docker run mkroli/karaf fails, possibly because the console is running and it gets an EOF immediately. docker run mkroli/karaf server works, but is a bit silent for my liking… can I somehow get it to output log:tail?
Best, Dan.

Re: Karaf in Docker

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi,

I recently used the following as entry point:
https://github.com/ANierbeck/Karaf-Vertx/blob/master/Vertx-Karaf-Cluster-Docker/src/main/resources/entrypoint.sh
the docker is generated through a maven build:
but that one uses this entry file:
https://github.com/ANierbeck/Karaf-Vertx/blob/master/Vertx-Karaf-Cluster-Docker/pom.xml#L59
that's it, you'll have a constant docker log.

regards, Achim


2017-06-16 17:47 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:

> Yes, but I tried with kellar.
>
> Let me check with 4.1.1 "vanilla".
>
> Regards
> JB
>
> On 06/16/2017 04:13 PM, Daniel McGreal wrote:
>
>> But your Dockerfile gets the distribution from
>> http://www-us.apache.org/dist/karaf/${KARAF_VERSION}/apache-
>> karaf-4.1.1.tar.gz <http://www-us.apache.org/dist
>> /karaf/$%7BKARAF_VERSION%7D/apache-karaf-4.1.1.tar.gz> ?
>>
>> On 16 Jun 2017, at 15:12, Jean-Baptiste Onofré <jb@nanthrax.net <mailto:
>>> jb@nanthrax.net>> wrote:
>>>
>>> Let me check as I'm using a custom Karaf distribution (kellar).
>>>
>>> I keep you posted.
>>>
>>> Regards
>>> JB
>>>
>>> On 06/16/2017 04:10 PM, Daniel McGreal wrote:
>>>
>>>> Indeed…
>>>> The mkroli Dockerfile is identical, apart from the MAINTAINER line, and
>>>> yet I get an error in some script file, and the container exits when the
>>>> console appears (presumably because it encounters an EOF?)...
>>>> Argent:~ dan$ docker run mkroli/karaf
>>>>         __ __                  ____
>>>>        / //_/____ __________ _/ __/
>>>>       / ,<  / __ `/ ___/ __ `/ /_
>>>>      / /| |/ /_/ / /  / /_/ / __/
>>>>     /_/ |_|\__,_/_/   \__,_/_/
>>>>   Apache Karaf (4.1.1)
>>>> Hit '<tab>' for a list of available commands
>>>> and '[cmd] --help' for help on a specific command.
>>>> Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.
>>>> Error in initialization script: /opt/karaf/etc/shell.init.script:
>>>> String index out of range: 0
>>>> karaf@root()>
>>>> Argent:~ dan$
>>>> Running in server mode works, but is a bit quiet. Is there a way for it
>>>> to also output something like log:tail when booted?
>>>> docker run mkroli/karaf server
>>>> I’m surprised yours works as-is, though I am finding Docker not to be
>>>> living up anywhere near to its hype.
>>>> Dan.
>>>>
>>>>> On 16 Jun 2017, at 15:04, Jean-Baptiste Onofré <jb@nanthrax.net
>>>>> <ma...@nanthrax.net>> wrote:
>>>>>
>>>>> Hi Dan,
>>>>>
>>>>> docker run kellar
>>>>>       __ __                  ____
>>>>>      / //_/____ __________ _/ __/
>>>>>     / ,<  / __ `/ ___/ __ `/ /_
>>>>>    / /| |/ /_/ / /  / /_/ / __/
>>>>>   /_/ |_|\__,_/_/   \__,_/_/
>>>>>
>>>>> Apache Karaf (4.1.1)
>>>>>
>>>>> Hit '<tab>' for a list of available commands
>>>>> and '[cmd] --help' for help on a specific command.
>>>>> Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.
>>>>>
>>>>>
>>>>> What issue do you have ?
>>>>>
>>>>> Do you see the MOTD and then it exits ?
>>>>>
>>>>> Regards
>>>>> JB
>>>>>
>>>>> On 06/16/2017 03:58 PM, Daniel McGreal wrote:
>>>>>
>>>>>> This seems fairly identical to the mkroli Dockerfile. Does docker run
>>>>>> work for you with this file then presumably? For me, it exits as soon as
>>>>>> the console appears.
>>>>>>
>>>>>>> On 16 Jun 2017, at 14:27, Jean-Baptiste Onofré <jb@nanthrax.net
>>>>>>> <ma...@nanthrax.net>> wrote:
>>>>>>>
>>>>>>> Hi Dan,
>>>>>>>
>>>>>>> Here's a dockerfile I'm using starting from the official java image:
>>>>>>>
>>>>>>> FROM java:8-jdk
>>>>>>> ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
>>>>>>>
>>>>>>> ENV KARAF_VERSION=4.1.1
>>>>>>>
>>>>>>> RUN wgethttp://www-us.apache.org/dist/karaf/${KARAF_VERSION}/apa
>>>>>>> che-karaf-${KARAF_VERSION}.tar.gz
>>>>>>> <http://www-us.apache.org/dist/karaf/$%7BKARAF_VERSION%7D/apache-karaf-$%7BKARAF_VERSION%7D.tar.gz>
>>>>>>> <http://www-us.apache.org/dist/karaf/$%7BKARAF_VERSION%7D/
>>>>>>> apache-karaf-$%7BKARAF_VERSION%7D.tar.gz>; \
>>>>>>>   mkdir /opt/karaf; \
>>>>>>>   tar --strip-components=1 -C /opt/karaf -xzf
>>>>>>> apache-karaf-${KARAF_VERSION}.tar.gz; \
>>>>>>>   rm apache-karaf-${KARAF_VERSION}.tar.gz; \
>>>>>>>   mkdir /deploy; \
>>>>>>>   sed -i 's/^\(felix\.fileinstall\.dir\s*=\s*\).*$/\1\/deploy/'
>>>>>>> /opt/karaf/etc/org.apache.felix.fileinstall-deploy.cfg
>>>>>>>
>>>>>>> VOLUME ["/deploy"]
>>>>>>> EXPOSE 1099 8101 44444
>>>>>>> ENTRYPOINT ["/opt/karaf/bin/karaf"]
>>>>>>>
>>>>>>> By the way, I'm in the process to create official Apache Karaf
>>>>>>> images.
>>>>>>>
>>>>>>> Regards
>>>>>>> JB
>>>>>>>
>>>>>>> On 06/16/2017 03:12 PM, Daniel McGreal wrote:
>>>>>>>
>>>>>>>> Hi Karaf users,
>>>>>>>> I’m trying to run Karaf in Docker using mkroli/karaf.
>>>>>>>> docker run mkroli/karaf fails, possibly because the console is
>>>>>>>> running and it gets an EOF immediately. docker run mkroli/karaf server
>>>>>>>> works, but is a bit silent for my liking… can I somehow get it to output
>>>>>>>> log:tail?
>>>>>>>> Best, Dan.
>>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Jean-Baptiste Onofré
>>>>>>> jbonofre@apache.org <ma...@apache.org><mailto:
>>>>>>> jbonofre@apache.org>
>>>>>>> http://blog.nanthrax.net <http://blog.nanthrax.net/>
>>>>>>> Talend -http://www.talend.com <http://www.talend.com/>
>>>>>>>
>>>>>>
>>>>> --
>>>>> Jean-Baptiste Onofré
>>>>> jbonofre@apache.org <ma...@apache.org><mailto:
>>>>> jbonofre@apache.org>
>>>>> http://blog.nanthrax.net <http://blog.nanthrax.net/>
>>>>> Talend -http://www.talend.com <http://www.talend.com/>
>>>>>
>>>>
>>> --
>>> Jean-Baptiste Onofré
>>> jbonofre@apache.org <ma...@apache.org>
>>> http://blog.nanthrax.net <http://blog.nanthrax.net/>
>>> Talend -http://www.talend.com <http://www.talend.com/>
>>>
>>
>>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

Re: Karaf in Docker

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Yes, but I tried with kellar.

Let me check with 4.1.1 "vanilla".

Regards
JB

On 06/16/2017 04:13 PM, Daniel McGreal wrote:
> But your Dockerfile gets the distribution from 
> http://www-us.apache.org/dist/karaf/${KARAF_VERSION}/apache-karaf-4.1.1.tar.gz 
> <http://www-us.apache.org/dist/karaf/$%7BKARAF_VERSION%7D/apache-karaf-4.1.1.tar.gz> ?
> 
>> On 16 Jun 2017, at 15:12, Jean-Baptiste Onofré <jb@nanthrax.net 
>> <ma...@nanthrax.net>> wrote:
>>
>> Let me check as I'm using a custom Karaf distribution (kellar).
>>
>> I keep you posted.
>>
>> Regards
>> JB
>>
>> On 06/16/2017 04:10 PM, Daniel McGreal wrote:
>>> Indeed…
>>> The mkroli Dockerfile is identical, apart from the MAINTAINER line, and yet I 
>>> get an error in some script file, and the container exits when the console 
>>> appears (presumably because it encounters an EOF?)...
>>> Argent:~ dan$ docker run mkroli/karaf
>>>         __ __                  ____
>>>        / //_/____ __________ _/ __/
>>>       / ,<  / __ `/ ___/ __ `/ /_
>>>      / /| |/ /_/ / /  / /_/ / __/
>>>     /_/ |_|\__,_/_/   \__,_/_/
>>>   Apache Karaf (4.1.1)
>>> Hit '<tab>' for a list of available commands
>>> and '[cmd] --help' for help on a specific command.
>>> Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.
>>> Error in initialization script: /opt/karaf/etc/shell.init.script: String 
>>> index out of range: 0
>>> karaf@root()>
>>> Argent:~ dan$
>>> Running in server mode works, but is a bit quiet. Is there a way for it to 
>>> also output something like log:tail when booted?
>>> docker run mkroli/karaf server
>>> I’m surprised yours works as-is, though I am finding Docker not to be living 
>>> up anywhere near to its hype.
>>> Dan.
>>>> On 16 Jun 2017, at 15:04, Jean-Baptiste Onofré <jb@nanthrax.net 
>>>> <ma...@nanthrax.net>> wrote:
>>>>
>>>> Hi Dan,
>>>>
>>>> docker run kellar
>>>>       __ __                  ____
>>>>      / //_/____ __________ _/ __/
>>>>     / ,<  / __ `/ ___/ __ `/ /_
>>>>    / /| |/ /_/ / /  / /_/ / __/
>>>>   /_/ |_|\__,_/_/   \__,_/_/
>>>>
>>>> Apache Karaf (4.1.1)
>>>>
>>>> Hit '<tab>' for a list of available commands
>>>> and '[cmd] --help' for help on a specific command.
>>>> Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.
>>>>
>>>>
>>>> What issue do you have ?
>>>>
>>>> Do you see the MOTD and then it exits ?
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> On 06/16/2017 03:58 PM, Daniel McGreal wrote:
>>>>> This seems fairly identical to the mkroli Dockerfile. Does docker run work 
>>>>> for you with this file then presumably? For me, it exits as soon as the 
>>>>> console appears.
>>>>>> On 16 Jun 2017, at 14:27, Jean-Baptiste Onofré <jb@nanthrax.net 
>>>>>> <ma...@nanthrax.net>> wrote:
>>>>>>
>>>>>> Hi Dan,
>>>>>>
>>>>>> Here's a dockerfile I'm using starting from the official java image:
>>>>>>
>>>>>> FROM java:8-jdk
>>>>>> ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
>>>>>>
>>>>>> ENV KARAF_VERSION=4.1.1
>>>>>>
>>>>>> RUN 
>>>>>> wgethttp://www-us.apache.org/dist/karaf/${KARAF_VERSION}/apache-karaf-${KARAF_VERSION}.tar.gz 
>>>>>> <http://www-us.apache.org/dist/karaf/$%7BKARAF_VERSION%7D/apache-karaf-$%7BKARAF_VERSION%7D.tar.gz>; 
>>>>>> \
>>>>>>   mkdir /opt/karaf; \
>>>>>>   tar --strip-components=1 -C /opt/karaf -xzf 
>>>>>> apache-karaf-${KARAF_VERSION}.tar.gz; \
>>>>>>   rm apache-karaf-${KARAF_VERSION}.tar.gz; \
>>>>>>   mkdir /deploy; \
>>>>>>   sed -i 's/^\(felix\.fileinstall\.dir\s*=\s*\).*$/\1\/deploy/' 
>>>>>> /opt/karaf/etc/org.apache.felix.fileinstall-deploy.cfg
>>>>>>
>>>>>> VOLUME ["/deploy"]
>>>>>> EXPOSE 1099 8101 44444
>>>>>> ENTRYPOINT ["/opt/karaf/bin/karaf"]
>>>>>>
>>>>>> By the way, I'm in the process to create official Apache Karaf images.
>>>>>>
>>>>>> Regards
>>>>>> JB
>>>>>>
>>>>>> On 06/16/2017 03:12 PM, Daniel McGreal wrote:
>>>>>>> Hi Karaf users,
>>>>>>> I’m trying to run Karaf in Docker using mkroli/karaf.
>>>>>>> docker run mkroli/karaf fails, possibly because the console is running 
>>>>>>> and it gets an EOF immediately. docker run mkroli/karaf server works, but 
>>>>>>> is a bit silent for my liking… can I somehow get it to output log:tail?
>>>>>>> Best, Dan.
>>>>>>
>>>>>> --
>>>>>> Jean-Baptiste Onofré
>>>>>> jbonofre@apache.org <ma...@apache.org>
>>>>>> http://blog.nanthrax.net <http://blog.nanthrax.net/>
>>>>>> Talend -http://www.talend.com <http://www.talend.com/>
>>>>
>>>> --
>>>> Jean-Baptiste Onofré
>>>> jbonofre@apache.org <ma...@apache.org>
>>>> http://blog.nanthrax.net <http://blog.nanthrax.net/>
>>>> Talend -http://www.talend.com <http://www.talend.com/>
>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org <ma...@apache.org>
>> http://blog.nanthrax.net <http://blog.nanthrax.net/>
>> Talend -http://www.talend.com <http://www.talend.com/>
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Karaf in Docker

Posted by Daniel McGreal <d....@gmail.com>.
But your Dockerfile gets the distribution from http://www-us.apache.org/dist/karaf/${KARAF_VERSION}/apache-karaf-4.1.1.tar.gz <http://www-us.apache.org/dist/karaf/$%7BKARAF_VERSION%7D/apache-karaf-4.1.1.tar.gz> ?

> On 16 Jun 2017, at 15:12, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> 
> Let me check as I'm using a custom Karaf distribution (kellar).
> 
> I keep you posted.
> 
> Regards
> JB
> 
> On 06/16/2017 04:10 PM, Daniel McGreal wrote:
>> Indeed…
>> The mkroli Dockerfile is identical, apart from the MAINTAINER line, and yet I get an error in some script file, and the container exits when the console appears (presumably because it encounters an EOF?)...
>> Argent:~ dan$ docker run mkroli/karaf
>>         __ __                  ____
>>        / //_/____ __________ _/ __/
>>       / ,<  / __ `/ ___/ __ `/ /_
>>      / /| |/ /_/ / /  / /_/ / __/
>>     /_/ |_|\__,_/_/   \__,_/_/
>>   Apache Karaf (4.1.1)
>> Hit '<tab>' for a list of available commands
>> and '[cmd] --help' for help on a specific command.
>> Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.
>> Error in initialization script: /opt/karaf/etc/shell.init.script: String index out of range: 0
>> karaf@root()>
>> Argent:~ dan$
>> Running in server mode works, but is a bit quiet. Is there a way for it to also output something like log:tail when booted?
>> docker run mkroli/karaf server
>> I’m surprised yours works as-is, though I am finding Docker not to be living up anywhere near to its hype.
>> Dan.
>>> On 16 Jun 2017, at 15:04, Jean-Baptiste Onofré <jb@nanthrax.net <ma...@nanthrax.net> <mailto:jb@nanthrax.net <ma...@nanthrax.net>>> wrote:
>>> 
>>> Hi Dan,
>>> 
>>> docker run kellar
>>>       __ __                  ____
>>>      / //_/____ __________ _/ __/
>>>     / ,<  / __ `/ ___/ __ `/ /_
>>>    / /| |/ /_/ / /  / /_/ / __/
>>>   /_/ |_|\__,_/_/   \__,_/_/
>>> 
>>> Apache Karaf (4.1.1)
>>> 
>>> Hit '<tab>' for a list of available commands
>>> and '[cmd] --help' for help on a specific command.
>>> Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.
>>> 
>>> 
>>> What issue do you have ?
>>> 
>>> Do you see the MOTD and then it exits ?
>>> 
>>> Regards
>>> JB
>>> 
>>> On 06/16/2017 03:58 PM, Daniel McGreal wrote:
>>>> This seems fairly identical to the mkroli Dockerfile. Does docker run work for you with this file then presumably? For me, it exits as soon as the console appears.
>>>>> On 16 Jun 2017, at 14:27, Jean-Baptiste Onofré <jb@nanthrax.net <ma...@nanthrax.net> <mailto:jb@nanthrax.net <ma...@nanthrax.net>>> wrote:
>>>>> 
>>>>> Hi Dan,
>>>>> 
>>>>> Here's a dockerfile I'm using starting from the official java image:
>>>>> 
>>>>> FROM java:8-jdk
>>>>> ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
>>>>> 
>>>>> ENV KARAF_VERSION=4.1.1
>>>>> 
>>>>> RUN wget http://www-us.apache.org/dist/karaf/${KARAF_VERSION}/apache-karaf-${KARAF_VERSION}.tar.gz <http://www-us.apache.org/dist/karaf/$%7BKARAF_VERSION%7D/apache-karaf-$%7BKARAF_VERSION%7D.tar.gz>; \
>>>>>   mkdir /opt/karaf; \
>>>>>   tar --strip-components=1 -C /opt/karaf -xzf apache-karaf-${KARAF_VERSION}.tar.gz; \
>>>>>   rm apache-karaf-${KARAF_VERSION}.tar.gz; \
>>>>>   mkdir /deploy; \
>>>>>   sed -i 's/^\(felix\.fileinstall\.dir\s*=\s*\).*$/\1\/deploy/' /opt/karaf/etc/org.apache.felix.fileinstall-deploy.cfg
>>>>> 
>>>>> VOLUME ["/deploy"]
>>>>> EXPOSE 1099 8101 44444
>>>>> ENTRYPOINT ["/opt/karaf/bin/karaf"]
>>>>> 
>>>>> By the way, I'm in the process to create official Apache Karaf images.
>>>>> 
>>>>> Regards
>>>>> JB
>>>>> 
>>>>> On 06/16/2017 03:12 PM, Daniel McGreal wrote:
>>>>>> Hi Karaf users,
>>>>>> I’m trying to run Karaf in Docker using mkroli/karaf.
>>>>>> docker run mkroli/karaf fails, possibly because the console is running and it gets an EOF immediately. docker run mkroli/karaf server works, but is a bit silent for my liking… can I somehow get it to output log:tail?
>>>>>> Best, Dan.
>>>>> 
>>>>> -- 
>>>>> Jean-Baptiste Onofré
>>>>> jbonofre@apache.org <ma...@apache.org> <mailto:jbonofre@apache.org <ma...@apache.org>>
>>>>> http://blog.nanthrax.net <http://blog.nanthrax.net/>
>>>>> Talend - http://www.talend.com <http://www.talend.com/>
>>> 
>>> -- 
>>> Jean-Baptiste Onofré
>>> jbonofre@apache.org <ma...@apache.org> <mailto:jbonofre@apache.org <ma...@apache.org>>
>>> http://blog.nanthrax.net <http://blog.nanthrax.net/>
>>> Talend - http://www.talend.com <http://www.talend.com/>
> 
> -- 
> Jean-Baptiste Onofré
> jbonofre@apache.org <ma...@apache.org>
> http://blog.nanthrax.net <http://blog.nanthrax.net/>
> Talend - http://www.talend.com <http://www.talend.com/>

Re: Karaf in Docker

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Let me check as I'm using a custom Karaf distribution (kellar).

I keep you posted.

Regards
JB

On 06/16/2017 04:10 PM, Daniel McGreal wrote:
> Indeed…
> 
> The mkroli Dockerfile is identical, apart from the MAINTAINER line, and yet I 
> get an error in some script file, and the container exits when the console 
> appears (presumably because it encounters an EOF?)...
> Argent:~ dan$ docker run mkroli/karaf
>          __ __                  ____
>         / //_/____ __________ _/ __/
>        / ,<  / __ `/ ___/ __ `/ /_
>       / /| |/ /_/ / /  / /_/ / __/
>      /_/ |_|\__,_/_/   \__,_/_/
> 
>    Apache Karaf (4.1.1)
> 
> Hit '<tab>' for a list of available commands
> and '[cmd] --help' for help on a specific command.
> Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.
> 
> Error in initialization script: /opt/karaf/etc/shell.init.script: String index 
> out of range: 0
> karaf@root()>
> Argent:~ dan$
> 
> Running in server mode works, but is a bit quiet. Is there a way for it to also 
> output something like log:tail when booted?
> docker run mkroli/karaf server
> 
> I’m surprised yours works as-is, though I am finding Docker not to be living up 
> anywhere near to its hype.
> 
> Dan.
> 
>> On 16 Jun 2017, at 15:04, Jean-Baptiste Onofré <jb@nanthrax.net 
>> <ma...@nanthrax.net>> wrote:
>>
>> Hi Dan,
>>
>> docker run kellar
>>        __ __                  ____
>>       / //_/____ __________ _/ __/
>>      / ,<  / __ `/ ___/ __ `/ /_
>>     / /| |/ /_/ / /  / /_/ / __/
>>    /_/ |_|\__,_/_/   \__,_/_/
>>
>>  Apache Karaf (4.1.1)
>>
>> Hit '<tab>' for a list of available commands
>> and '[cmd] --help' for help on a specific command.
>> Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.
>>
>>
>> What issue do you have ?
>>
>> Do you see the MOTD and then it exits ?
>>
>> Regards
>> JB
>>
>> On 06/16/2017 03:58 PM, Daniel McGreal wrote:
>>> This seems fairly identical to the mkroli Dockerfile. Does docker run work 
>>> for you with this file then presumably? For me, it exits as soon as the 
>>> console appears.
>>>> On 16 Jun 2017, at 14:27, Jean-Baptiste Onofré <jb@nanthrax.net 
>>>> <ma...@nanthrax.net>> wrote:
>>>>
>>>> Hi Dan,
>>>>
>>>> Here's a dockerfile I'm using starting from the official java image:
>>>>
>>>> FROM java:8-jdk
>>>> ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
>>>>
>>>> ENV KARAF_VERSION=4.1.1
>>>>
>>>> RUN wget 
>>>> http://www-us.apache.org/dist/karaf/${KARAF_VERSION}/apache-karaf-${KARAF_VERSION}.tar.gz; 
>>>> \
>>>>    mkdir /opt/karaf; \
>>>>    tar --strip-components=1 -C /opt/karaf -xzf 
>>>> apache-karaf-${KARAF_VERSION}.tar.gz; \
>>>>    rm apache-karaf-${KARAF_VERSION}.tar.gz; \
>>>>    mkdir /deploy; \
>>>>    sed -i 's/^\(felix\.fileinstall\.dir\s*=\s*\).*$/\1\/deploy/' 
>>>> /opt/karaf/etc/org.apache.felix.fileinstall-deploy.cfg
>>>>
>>>> VOLUME ["/deploy"]
>>>> EXPOSE 1099 8101 44444
>>>> ENTRYPOINT ["/opt/karaf/bin/karaf"]
>>>>
>>>> By the way, I'm in the process to create official Apache Karaf images.
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> On 06/16/2017 03:12 PM, Daniel McGreal wrote:
>>>>> Hi Karaf users,
>>>>> I’m trying to run Karaf in Docker using mkroli/karaf.
>>>>> docker run mkroli/karaf fails, possibly because the console is running and 
>>>>> it gets an EOF immediately. docker run mkroli/karaf server works, but is a 
>>>>> bit silent for my liking… can I somehow get it to output log:tail?
>>>>> Best, Dan.
>>>>
>>>> -- 
>>>> Jean-Baptiste Onofré
>>>> jbonofre@apache.org <ma...@apache.org>
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>
>> -- 
>> Jean-Baptiste Onofré
>> jbonofre@apache.org <ma...@apache.org>
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Karaf in Docker

Posted by Daniel McGreal <d....@gmail.com>.
Indeed…

The mkroli Dockerfile is identical, apart from the MAINTAINER line, and yet I get an error in some script file, and the container exits when the console appears (presumably because it encounters an EOF?)...
Argent:~ dan$ docker run mkroli/karaf
        __ __                  ____
       / //_/____ __________ _/ __/
      / ,<  / __ `/ ___/ __ `/ /_
     / /| |/ /_/ / /  / /_/ / __/
    /_/ |_|\__,_/_/   \__,_/_/

  Apache Karaf (4.1.1)

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.

Error in initialization script: /opt/karaf/etc/shell.init.script: String index out of range: 0
karaf@root()>
Argent:~ dan$

Running in server mode works, but is a bit quiet. Is there a way for it to also output something like log:tail when booted?
docker run mkroli/karaf server

I’m surprised yours works as-is, though I am finding Docker not to be living up anywhere near to its hype.

Dan.

> On 16 Jun 2017, at 15:04, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> 
> Hi Dan,
> 
> docker run kellar
>        __ __                  ____
>       / //_/____ __________ _/ __/
>      / ,<  / __ `/ ___/ __ `/ /_
>     / /| |/ /_/ / /  / /_/ / __/
>    /_/ |_|\__,_/_/   \__,_/_/
> 
>  Apache Karaf (4.1.1)
> 
> Hit '<tab>' for a list of available commands
> and '[cmd] --help' for help on a specific command.
> Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.
> 
> 
> What issue do you have ?
> 
> Do you see the MOTD and then it exits ?
> 
> Regards
> JB
> 
> On 06/16/2017 03:58 PM, Daniel McGreal wrote:
>> This seems fairly identical to the mkroli Dockerfile. Does docker run work for you with this file then presumably? For me, it exits as soon as the console appears.
>>> On 16 Jun 2017, at 14:27, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>>> 
>>> Hi Dan,
>>> 
>>> Here's a dockerfile I'm using starting from the official java image:
>>> 
>>> FROM java:8-jdk
>>> ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
>>> 
>>> ENV KARAF_VERSION=4.1.1
>>> 
>>> RUN wget http://www-us.apache.org/dist/karaf/${KARAF_VERSION}/apache-karaf-${KARAF_VERSION}.tar.gz; \
>>>    mkdir /opt/karaf; \
>>>    tar --strip-components=1 -C /opt/karaf -xzf apache-karaf-${KARAF_VERSION}.tar.gz; \
>>>    rm apache-karaf-${KARAF_VERSION}.tar.gz; \
>>>    mkdir /deploy; \
>>>    sed -i 's/^\(felix\.fileinstall\.dir\s*=\s*\).*$/\1\/deploy/' /opt/karaf/etc/org.apache.felix.fileinstall-deploy.cfg
>>> 
>>> VOLUME ["/deploy"]
>>> EXPOSE 1099 8101 44444
>>> ENTRYPOINT ["/opt/karaf/bin/karaf"]
>>> 
>>> By the way, I'm in the process to create official Apache Karaf images.
>>> 
>>> Regards
>>> JB
>>> 
>>> On 06/16/2017 03:12 PM, Daniel McGreal wrote:
>>>> Hi Karaf users,
>>>> I’m trying to run Karaf in Docker using mkroli/karaf.
>>>> docker run mkroli/karaf fails, possibly because the console is running and it gets an EOF immediately. docker run mkroli/karaf server works, but is a bit silent for my liking… can I somehow get it to output log:tail?
>>>> Best, Dan.
>>> 
>>> -- 
>>> Jean-Baptiste Onofré
>>> jbonofre@apache.org
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
> 
> -- 
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com


Re: Karaf in Docker

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Dan,

docker run kellar
         __ __                  ____
        / //_/____ __________ _/ __/
       / ,<  / __ `/ ___/ __ `/ /_
      / /| |/ /_/ / /  / /_/ / __/
     /_/ |_|\__,_/_/   \__,_/_/

   Apache Karaf (4.1.1)

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.


What issue do you have ?

Do you see the MOTD and then it exits ?

Regards
JB

On 06/16/2017 03:58 PM, Daniel McGreal wrote:
> This seems fairly identical to the mkroli Dockerfile. Does docker run work for you with this file then presumably? For me, it exits as soon as the console appears.
> 
> 
>> On 16 Jun 2017, at 14:27, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>>
>> Hi Dan,
>>
>> Here's a dockerfile I'm using starting from the official java image:
>>
>> FROM java:8-jdk
>> ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
>>
>> ENV KARAF_VERSION=4.1.1
>>
>> RUN wget http://www-us.apache.org/dist/karaf/${KARAF_VERSION}/apache-karaf-${KARAF_VERSION}.tar.gz; \
>>     mkdir /opt/karaf; \
>>     tar --strip-components=1 -C /opt/karaf -xzf apache-karaf-${KARAF_VERSION}.tar.gz; \
>>     rm apache-karaf-${KARAF_VERSION}.tar.gz; \
>>     mkdir /deploy; \
>>     sed -i 's/^\(felix\.fileinstall\.dir\s*=\s*\).*$/\1\/deploy/' /opt/karaf/etc/org.apache.felix.fileinstall-deploy.cfg
>>
>> VOLUME ["/deploy"]
>> EXPOSE 1099 8101 44444
>> ENTRYPOINT ["/opt/karaf/bin/karaf"]
>>
>> By the way, I'm in the process to create official Apache Karaf images.
>>
>> Regards
>> JB
>>
>> On 06/16/2017 03:12 PM, Daniel McGreal wrote:
>>> Hi Karaf users,
>>> I’m trying to run Karaf in Docker using mkroli/karaf.
>>> docker run mkroli/karaf fails, possibly because the console is running and it gets an EOF immediately. docker run mkroli/karaf server works, but is a bit silent for my liking… can I somehow get it to output log:tail?
>>> Best, Dan.
>>
>> -- 
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Karaf in Docker

Posted by Daniel McGreal <d....@gmail.com>.
This seems fairly identical to the mkroli Dockerfile. Does docker run work for you with this file then presumably? For me, it exits as soon as the console appears.


> On 16 Jun 2017, at 14:27, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> 
> Hi Dan,
> 
> Here's a dockerfile I'm using starting from the official java image:
> 
> FROM java:8-jdk
> ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
> 
> ENV KARAF_VERSION=4.1.1
> 
> RUN wget http://www-us.apache.org/dist/karaf/${KARAF_VERSION}/apache-karaf-${KARAF_VERSION}.tar.gz; \
>    mkdir /opt/karaf; \
>    tar --strip-components=1 -C /opt/karaf -xzf apache-karaf-${KARAF_VERSION}.tar.gz; \
>    rm apache-karaf-${KARAF_VERSION}.tar.gz; \
>    mkdir /deploy; \
>    sed -i 's/^\(felix\.fileinstall\.dir\s*=\s*\).*$/\1\/deploy/' /opt/karaf/etc/org.apache.felix.fileinstall-deploy.cfg
> 
> VOLUME ["/deploy"]
> EXPOSE 1099 8101 44444
> ENTRYPOINT ["/opt/karaf/bin/karaf"]
> 
> By the way, I'm in the process to create official Apache Karaf images.
> 
> Regards
> JB
> 
> On 06/16/2017 03:12 PM, Daniel McGreal wrote:
>> Hi Karaf users,
>> I’m trying to run Karaf in Docker using mkroli/karaf.
>> docker run mkroli/karaf fails, possibly because the console is running and it gets an EOF immediately. docker run mkroli/karaf server works, but is a bit silent for my liking… can I somehow get it to output log:tail?
>> Best, Dan.
> 
> -- 
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com


Re: Karaf in Docker

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Dan,

Here's a dockerfile I'm using starting from the official java image:

FROM java:8-jdk
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64

ENV KARAF_VERSION=4.1.1

RUN wget 
http://www-us.apache.org/dist/karaf/${KARAF_VERSION}/apache-karaf-${KARAF_VERSION}.tar.gz; 
\
     mkdir /opt/karaf; \
     tar --strip-components=1 -C /opt/karaf -xzf 
apache-karaf-${KARAF_VERSION}.tar.gz; \
     rm apache-karaf-${KARAF_VERSION}.tar.gz; \
     mkdir /deploy; \
     sed -i 's/^\(felix\.fileinstall\.dir\s*=\s*\).*$/\1\/deploy/' 
/opt/karaf/etc/org.apache.felix.fileinstall-deploy.cfg

VOLUME ["/deploy"]
EXPOSE 1099 8101 44444
ENTRYPOINT ["/opt/karaf/bin/karaf"]

By the way, I'm in the process to create official Apache Karaf images.

Regards
JB

On 06/16/2017 03:12 PM, Daniel McGreal wrote:
> Hi Karaf users,
> I’m trying to run Karaf in Docker using mkroli/karaf.
> docker run mkroli/karaf fails, possibly because the console is running and it 
> gets an EOF immediately. docker run mkroli/karaf server works, but is a bit 
> silent for my liking… can I somehow get it to output log:tail?
> Best, Dan.

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com