GithubHelp home page GithubHelp logo

fabric8-docker's Introduction

fabric8-docker

This project builds a docker container for running fabric8

Try it out

If you have docker installed you should be able to try it out via

docker pull fabric8/fabric8
docker run --name myfabric -Pit -e DOCKER_HOST=http://192.168.59.103:2375 fabric8/fabric8

Where the value of DOCKER_HOST should be the URL (ideally http) where the docker container can access the Docker Remote API to be able to create/start/stop containers in docker.

To find the port to connect to the web console try:

docker port myfabric 8181

You may wish to replace the 0.0.0.0 address with the actual ip address of your DOCKER_HOST.

You can pass in various environment variables to customise how a fabric is created or joined; or specify stand alone mode if required etc.

In addition, the Docker image allows you to override a few other things through environment variables:

  • ADMIN_USERNAME: the admin username you can use to connect to the Karaf shell as & authenticate to HawtIO (default: admin)
  • ADMIN_PASSWORD: the admin password to use (default: admin)
  • DOCKER_HOST: the URI to the Docker REST endpoint. This is necessary if you want to manage Docker containers from your Docker container :) (default: tcp://172.17.42.1:4243)

You can then run docker attach or docker logs to get the logs at any time.

Run docker ps to see all the running containers or docker inspect $containerID to view the IP address and details of a container

Known issues

  • there is a known issue with the use of boot2docker where permissions are not setup correctly so the fabric8 cannot startup. Works fine on linux though!
  • DOCKER_HOST must point to a TCP / HTTP endpoint for now; we don't yet support using unix sockets to communicate with the Docker REST API.

Using the interactive shell

If you want to run the docker container a bit more like running the bin/fabric8 command where you get an interactive colourful ssh shell on the command line then try this:

docker run -Pit fabric8/fabric8 /home/fabric8/fabric8-karaf/bin/fabric8

Accessing the web console

Find the port that 8181 is exposed from the container to the host via

docker ps

and looking for the text 4XXXX->8181 then find the correct value of 4XXXX.

Then open a browser at http://$HOST:4XXX using the correct value of HOST. If you are on linux then this can be localhost or if you use boot2docker then its the IP adress output via

boot2docker ip

You should now see the fabric8 web console from which you can browse the git repository, running containers and create new containers.

Creating new containers (like Java Containers, Spring Boot, Tomcat, Jetty etc) creates a new docker image on the fly based on the profile metadata and deployment units then starts it up using the Docker Remote API.

Building the docker container locally

We have a Docker Index trusted build setup to automatically rebuild the fabric8/fabric8 container whenever the Dockerfile is updated, so you shouldn't have to rebuild it locally. But if you want to, here's now to do it...

Once you have installed docker you should be able to create the containers via the following:

If you are on OS X then see How to use Docker on OS X.

git clone [email protected]:fabric8io/fabric8-docker.git
cd fabric8-docker
./build.sh

The fabric8 container should then build.

Using a local build

To create a fabric8 using your local build try the following:

docker run -Pit -e DOCKER_HOST=http://192.168.59.103:2375 -e FABRIC8_DOCKER_IMAGE_FABRIC8=fabric8:fabric8 fabric8:fabric8

This will then startup your locally built image fabric8:fabric8 and then use that image when creating any new karaf based containers via the CLI or web console.

Experimenting

To spin up a shell in one of the containers try:

docker run -Pit fabric8/fabric8 /bin/bash

You can then noodle around the container and run stuff & look at files etc.

Docker resources

fabric8-docker's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fabric8-docker's Issues

Can't run /bin/bash with error 404

pires@as1:~$ sudo docker run -p 8181 -i -t fabric8:fabric8 /bin/bash
Unable to find image 'fabric8:fabric8' (tag: fabric8) locally
Pulling repository fabric8
2014/01/22 13:03:06 HTTP code: 404

Dockerfile refers to a no longer available version

...
RUN curl --silent --output fabric8.zip https://repository.jboss.org/nexus/content/groups/ea/io/fabric8/fabric8-karaf/1.0.0.redhat-366/fabric8-karaf-1.0.0.redhat-366.zip
...

Current view (2014-04-29) of https://repository.jboss.org/nexus/content/groups/ea/io/fabric8/fabric8-karaf/ :

1.0.0.redhat-328/   Tue Jan 28 10:43:01 EST 2014        
1.0.0.redhat-355/   Sun Mar 02 21:35:13 EST 2014        
1.0.0.redhat-378/   Wed Apr 02 14:07:16 EDT 2014        
maven-metadata.xml.md5  Wed Apr 02 06:55:04 EDT 2014    33  
maven-metadata.xml.sha1     Wed Apr 02 06:55:04 EDT 2014    41  

container-create-ssh fails

Not sure if I should open this on fabric8 or fabric8-docker

Either when invoked through my script or when done directly through karaf shell the provisioning phase fails.

Fabric8:admin@root> container-create-ssh --resolver localip --host 172.17.0.3 --user fuse  --path /home/fuse/provisioned fab02
The following containers have been created successfully:

    Container: fab02.

The container is reported to be created succesfully but it never starts:

Fabric8:admin@root> container-list 
[id]                           [version] [connected] [profiles]                                         [provision status]
fab02                          1.0       false       default                                            
root*                          1.0       true        fabric, fabric-ensemble-0000-1                     success

Enabling temporarily set DEBUG on root node shows a hint of the real problem:

Running: chmod +x bin/admin bin/admin.bat bin/client bin/client.bat bin/fusefabric bin/fusefabric.bat bin/karaf bin/karaf.bat bin/setenv bin/setenv.bat bin/shell bin/shell.bat bin/start bin/start.bat bin/status bin/status.bat bin/stop bin/stop.bat
sed: -e expression #1, char 70: unknown option to `s'
nohup: appending output to `nohup.out'
Command Failed:Could not find Karaf instance.properties

Error running fabric8 in docker

Seems like the owner of /home/fabric8/fabric8-karaf is wrong.

docker run -P -it fabric8/fabric8 /home/fabric8/fabric8-karaf/bin/fabric8
Unable to update instance pid: Unable to create directory /home/fabric8/fabric8-karaf/instances
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.apache.karaf.main.Main.doLock(Main.java:1442)
    at org.apache.karaf.main.Main.lock(Main.java:1430)
    at org.apache.karaf.main.Main$1.run(Main.java:357)
Caused by: java.lang.RuntimeException: Karaf can't startup, make sure the log file can be accessed and written by the user starting Karaf : java.io.FileNotFoundException: /home/fabric8/fabric8-karaf/lock (Permission denied)
    at org.apache.karaf.main.SimpleFileLock.<init>(SimpleFileLock.java:53)
    ... 7 more

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.