---------- Weitergeleitete Nachricht ---------- Von: "Eliot Kimber" ekimber@contrext.com Datum: 28.01.2016 11:57 nachm. Betreff: Re: [basex-talk] Status of BaseX Docker Container? An: "Christian Grün" christian.gruen@gmail.com Cc:
Refined the dfst/basex container definition and figured out what I was doing wrong on OS X.
I updated the container to expose as volumes the repo, data, and webapp directories. This allows two things:
- You can mound a host directory as any of these directories in place of
the default one. This lets you have local persistent storage or swap in a different set of modules or webapp modules for the same container.
- Other containers can access these volumes from within the same Docker
network using the --volumes-from parameter of the docker run command (not sure why you'd want to do this but there might be some reason.
On OS X I realized that when you start a Docker-specific shell window (e.g., using the Kitematic tools "docker cli" button) it sets environment variables that will not, by default, be set in any other shell window. So you have to remember to do all your Docker stuff in the cli shell or figure out how to set the environment in your .bashrc or whatever.
In any case, assuming you have Docker otherwise running you can run the container like this:
docker run -d -p 8984:8984 -p 1984:1984 --name basex dfst/basex
This will run the server as a background task (-d) and expose the default server ports on the docker machine.
If you want to swap in your own data directory you use the -v parameter like so:
docker run -d -p 8984:8984 -p 1984:1984 -v /Users/someuser/data:/opt/basex/data --name basex dfst/basex
However, I don't yet know what the right permissions settings are to allow basex to write to a mounted data volume. In my experiments BaseX could create a database directory but then failed with a permissions error when it tried to create its files with in it. Something silly on my part I'm sure.
My understanding is that Docker on OS X only shares your home directory through the VirtualBox VM, so you can't mount directories outside your home directory, at least by default. You also have to make sure the directory permissions allow the basex user to write to it.
You then use the IP address of the Docker machine as the base IP address, which you can determine using the command "docker-machine ip default:
bash-3.2$ docker-machine ip default 192.168.99.100
With that you can connect to the running Web server using http://192.168.99.100:8984 and away you go.
The image is "dfst/basex" on the Docker hub server. I also created an image with the tag "8.3" (dfst/basex:8.3).
Cheers,
Eliot
Eliot Kimber, Owner Contrext, LLC http://contrext.com
On 1/27/16, 4:06 AM, "Christian Grün" christian.gruen@gmail.com wrote:
…thanks for the hints on the Windows solution! I’ll try it in a while.
On Tue, Jan 26, 2016 at 11:13 PM, Eliot Kimber ekimber@contrext.com wrote:
Forgot to add the Windows part:
Under windows have to explicitly publish the ports when running the container:
docker run --name=basex -p 8984:8984 -p 1984:1984 dfst/basex
then you can use the IP address of the docker-engine VM to connect to the server:
you can get the ip address using the "docker-machine ip" command: c:\Program Files\Docker Toolbox>docker-machine ls NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS default - virtualbox Running tcp://192.168.99.100:2376 v1.9.1 c:\Program Files\Docker Toolbox>docker-machine ip default 192.168.99.100
the docker-machine command replaces the older boot2docker command
So now I have BaseX server running and accessible as Docker containers under Windows and CentOS.
OSX is still a problem: there's some issue with the docker daemon and getting the docker client to connect to it. Haven't been able to find a good solution in my searching. Very annoying.
Cheers,
E.
Eliot Kimber, Owner Contrext, LLC http://contrext.com
On 1/26/16, 3:50 PM, "Eliot Kimber" <basex-talk-bounces@mailman.uni-konstanz.de on behalf of ekimber@contrext.com> wrote:
For what it's worth, I've pushed a generic BaseX HTTP container to Docker Hub as "dfst/basex". It exposes the default ports for the base and HTTP servers (1984 and 8984).
From a Linux system you connect by using the IP address of the Docker network, e.g.:
Under Windows:
The DockerFile is in GitHub here:
https://github.com/dita-for-small-teams/dfst-docker
My next task will be to create a container based on this one that includes specific configuration and the DFST Web application modules. Should be easy once I get to it.
Cheers,
E.
Eliot Kimber, Owner Contrext, LLC http://contrext.com
On 1/26/16, 9:48 AM, "Eliot Kimber" <basex-talk-bounces@mailman.uni-konstanz.de on behalf of ekimber@contrext.com> wrote:
OK, I'm going to proceed with making a generic basex Docker container in the DFST Docker project on GitHub. I'm using Andreas' as a starting point but it's pretty trivial.
I'm working/testing on OS X, Windows, and CentOS so I should be able
to
get something going.
Cheers,
E.
Eliot Kimber, Owner Contrext, LLC http://contrext.com
On 1/26/16, 2:02 AM, "Christian Grün" christian.gruen@gmail.com wrote:
Hi Eliot,
Personally, I had a hard time making Docker work on Windows machines, but we have various Docker aficionados in our team and around, so I hope they¹ll give you some feedback soon.
Cheers, Christian
On Sun, Jan 24, 2016 at 8:22 PM, Eliot Kimber ekimber@contrext.com wrote: > I'm working toward using BaseX in a Docker container as part of the >DITA > for Small Teams project (we're trying to set up a system of Docker > containers with all the DFST parts integrated out of the box). > > I notice that Andreas Jung has create a simple container here: > > https://github.com/zopyx/docker-basex > > And pushed it to the Docker Hub in the basex namespace. > > I'm wondering what the relationship of this is, if any, to any >official > BaseX Docker support? > > Thanks, > > Eliot > ---- > Eliot Kimber, Owner > Contrext, LLC > http://contrext.com > > > >
basex-talk@mailman.uni-konstanz.de