Page 1 of 35
Docker is different to Vagrant.
|Dev||Dev & Production|
|Many apps||Single app|
This is a yum/apt online on Linux. But, I'm on Mac. Several Mac tutorials use Vagrant to run Docker.
Alternatively, Docker can be run more transparently using boot2docker:
brew install boot2docker boot2docker init boot2docker up export DOCKER_HOST=tcp://localhost:4243
You should be able to check the version now:
The steps I've seen over and over again are the ones I'll use here:
I've created a simple app to start, which can be run from the command line:
git clone https://github.com/alexec/dropwizard-helloworld.git mvm package
Dockerfile in the project directory:
FROM centos RUN yum -y install java-1.7.0-openjdk-devel.x86_64 ADD target/dropwizard-helloworld-1.0-SNAPSHOT.jar dropwizard-helloworld-1.0-SNAPSHOT.jar ADD hello-world.yml hello-world.yml CMD ["java", "-jar", "dropwizard-helloworld-1.0-SNAPSHOT.jar", "server", "hello-world.yml"] EXPOSE 8081
Dockerfile is an all in one recipe, and that complete all the steps:
docker build .
When it's complete, it'll print a hash for the image it's built:
Successfully built 6aecab0dc0d4
It's important to understand there's a big difference between an image and a container hashes. They look the same, and as commands you might expert to take a container ID sometimes take an image ID!
Start it up:
docker run -i -p 8080 6aecab0dc0d4
As I'm running Docker within a VM (as I'm on OS-X), I need to set-up a port forward:
VBoxManage controlvm boot2docker-vm natpf1 "8080,tcp,127.0.0.1,8080,,8080"
You can test in your browser: http://localhost:8080/hello-world
Tip: Really useful debugging command (like
docker run -i 6aecab0dc0d4 bash
I've recently been working on an XML API that is exposed to third-parties and wonder if there's a good way to keen the documentation up to date, other that an error-prone copy and paste exercise from unit tests.
There are two sets of information that need to be published.
There are two solutions that can be applied to existing code without too much modification:
I've updated the source code to use Selenide rather than Geb.
Quick Comparison chart:
I like Selenium, and could consider it for a commercial project. Not something I could quite do with Geb yet.