Skip to content

Commit

Permalink
Merge branch 'master' into smf-jersey-118
Browse files Browse the repository at this point in the history
Conflicts:
	pom.xml
	src/main/java/com/github/dockerjava/jaxrs1/DockerClientBuilder.java
	src/main/java/com/github/dockerjava/jaxrs2/DockerCmdExecFactoryImpl.java
	src/test/java/com/github/dockerjava/client/AbstractDockerClientTest.java
	src/test/java/com/github/dockerjava/core/command/AuthCmdImplTest.java
	src/test/java/com/github/dockerjava/core/command/StartContainerCmdImplTest.java
	src/test/java/com/github/dockerjava/jaxrs1/TestDockerCmdExecFactory.java
  • Loading branch information
Sean Fitts committed Nov 17, 2014
2 parents 0235cf5 + 39130d3 commit 7d2bbfe
Show file tree
Hide file tree
Showing 103 changed files with 3,373 additions and 598 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: java
jdk:
- oraclejdk7
after_success:
- echo "<settings><servers><server><id>ossrh</id><username>\${env.OSSRH_USER}</username><password>\${env.OSSRH_PASS}</password></server></servers></settings>" > ~/settings.xml
- mvn deploy -DskipITs --settings ~/settings.xml
111 changes: 111 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
Change Log
===

* [#92](https://github.com/docker-java/docker-java/pull/92) Add travis-ci support
* [#90](https://github.com/docker-java/docker-java/pull/90) Update DockerClientBuilder.java
* [#88](https://github.com/docker-java/docker-java/pull/88) Add support for private repositories and pull/push authentication

docker-java-0.10.3
---

* [#87](https://github.com/docker-java/docker-java/pull/87) Improve adding of port bindings
* [#83](https://github.com/docker-java/docker-java/pull/83) Loading of custom DockerCmdExecFactory
* [#81](https://github.com/docker-java/docker-java/pull/81) Env config
* [#82](https://github.com/docker-java/docker-java/pull/82) Allow multiple port bindings per ExposedPort
* [#80](https://github.com/docker-java/docker-java/pull/80) explicitly use the latest image version
* [#79](https://github.com/docker-java/docker-java/pull/79) Move slow tests to integration test phase, enable tests by default
* [#76](https://github.com/docker-java/docker-java/pull/76) New enum \"InternetProtocol\" for supported IP protocols replaces \"scheme\"
* [#75](https://github.com/docker-java/docker-java/pull/75) Use ExposedPort.toString() in serialization
* [#74](https://github.com/docker-java/docker-java/pull/74) Use project.build.sourceEncoding in compiler
* [#73](https://github.com/docker-java/docker-java/pull/73) Improve parsing and serialization of Link
* [#70](https://github.com/docker-java/docker-java/pull/70) Improve instantiation and serialization of Bind

docker-java-0.10.2
---

* [#69](https://github.com/docker-java/docker-java/pull/69) Use canonical form of Docker folder when building TAR files
* [#68](https://github.com/docker-java/docker-java/pull/68) Set Jersey client CommonProperties.FEATURE_AUTO_DISCOVERY_DISABLE
* [#67](https://github.com/docker-java/docker-java/pull/67) typo in README.md
* [#65](https://github.com/docker-java/docker-java/pull/65) Added static method udp in ExposedPort
* [#63](https://github.com/docker-java/docker-java/pull/63) Bind.parse() fails when access mode is specified
* [#57](https://github.com/docker-java/docker-java/pull/57) Add streaming events API
* [#59](https://github.com/docker-java/docker-java/pull/59) Update readme to include corrected api example
* [#2](https://github.com/docker-java/docker-java/pull/2) Move to new maven coordinate com.github.docker-java:docker-java
* [#56](https://github.com/docker-java/docker-java/pull/56) Update README.md
* [#58](https://github.com/docker-java/docker-java/pull/58) Code clear and bug fix

docker-java-0.10.1
---

* [#49](https://github.com/docker-java/docker-java/pull/49) Allow user to check where volume is binded on host
* [#47](https://github.com/docker-java/docker-java/pull/47) let CompressArchiveUtil preserve executable flags
* [#46](https://github.com/docker-java/docker-java/pull/46) Fixes to AttachContainerCmd and CreateContainerCmd.

docker-java-0.10.0
---

* [#45](https://github.com/docker-java/docker-java/pull/45) Fix Issue #44 Adjusting DNS property type to be a String array as specified by the Doc...
* [#38](https://github.com/docker-java/docker-java/pull/38) Remove special-case for one \":\" from PullCommand
* [#37](https://github.com/docker-java/docker-java/pull/37) Starts v0.10.0
* [#35](https://github.com/docker-java/docker-java/pull/35) Exposing the withTTY method for container creation.

docker-java-0.9.1
---

* [#31](https://github.com/docker-java/docker-java/pull/31) Change VolumesFrom to handle array
* [#29](https://github.com/docker-java/docker-java/pull/29) Makes Config a public, immutable class with a builder
* [#22](https://github.com/docker-java/docker-java/pull/22) Fixes for startContainerCmd
* [#19](https://github.com/docker-java/docker-java/pull/19) Add missing options to BuildCmd and set them to match Docker client.
* [#16](https://github.com/docker-java/docker-java/pull/16) Build image improvements

docker-java-0.9.0
---

* [#14](https://github.com/docker-java/docker-java/pull/14) Use RegEx to match ADD command from Dockerfile.
* [#9](https://github.com/docker-java/docker-java/pull/9) Add a build command accepting a tar as a InputStream, so we can build the Dockerfile TAR on the fly without a temporary folder.

docker-java-0.8.2
---

* [#2](https://github.com/docker-java/docker-java/pull/2) Move to new maven coordinate com.github.docker-java:docker-java
* [#1](https://github.com/docker-java/docker-java/pull/1) Merge
* [#2](https://github.com/docker-java/docker-java/pull/2) Move to new maven coordinate com.github.docker-java:docker-java
* [#66](https://github.com/docker-java/docker-java/pull/66) Backport the new structure to Jersey 1.18
* [#65](https://github.com/docker-java/docker-java/pull/65) Added static method udp in ExposedPort
* [#61](https://github.com/docker-java/docker-java/pull/61)
* [#60](https://github.com/docker-java/docker-java/pull/60) Added additional callback methods to EventCallback
* [#1](https://github.com/docker-java/docker-java/pull/1) Merge
* [#55](https://github.com/docker-java/docker-java/pull/55)
* [#58](https://github.com/docker-java/docker-java/pull/58) Code clear and bug fix
* [#54](https://github.com/docker-java/docker-java/pull/54)
* [#3](https://github.com/docker-java/docker-java/pull/3)
* [#2](https://github.com/docker-java/docker-java/pull/2) Move to new maven coordinate com.github.docker-java:docker-java
* [#1](https://github.com/docker-java/docker-java/pull/1) Merge
* [#34](https://github.com/docker-java/docker-java/pull/34)
* [#36](https://github.com/docker-java/docker-java/pull/36)
* [#37](https://github.com/docker-java/docker-java/pull/37) Starts v0.10.0
* [#32](https://github.com/docker-java/docker-java/pull/32)

docker-java-0.8.1
---


docker-java-0.8.1
---

* [#28](https://github.com/docker-java/docker-java/pull/28) Improves use of docker-java in unit tests
* [#30](https://github.com/docker-java/docker-java/pull/30) Add ping method
* [#27](https://github.com/docker-java/docker-java/pull/27) Added a close method to DockerClient
* [#26](https://github.com/docker-java/docker-java/pull/26)
* [#24](https://github.com/docker-java/docker-java/pull/24)
* [#23](https://github.com/docker-java/docker-java/pull/23)
* [#22](https://github.com/docker-java/docker-java/pull/22) Fixes for startContainerCmd
* [#20](https://github.com/docker-java/docker-java/pull/20)
* [#19](https://github.com/docker-java/docker-java/pull/19) Add missing options to BuildCmd and set them to match Docker client.
* [#18](https://github.com/docker-java/docker-java/pull/18) Added Container-Linking
* [#16](https://github.com/docker-java/docker-java/pull/16) Build image improvements
* [#15](https://github.com/docker-java/docker-java/pull/15) Collection of changes driven by use in gradle-docker and on Windows
* [#14](https://github.com/docker-java/docker-java/pull/14) Use RegEx to match ADD command from Dockerfile.
* [#9](https://github.com/docker-java/docker-java/pull/9) Add a build command accepting a tar as a InputStream, so we can build the Dockerfile TAR on the fly without a temporary folder.
* [#5](https://github.com/docker-java/docker-java/pull/5) add paused field in ContainerInspectResponse
* [#6](https://github.com/docker-java/docker-java/pull/6)
89 changes: 58 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,41 @@
[![Build Status](https://travis-ci.org/docker-java/docker-java.svg?branch=master)](https://travis-ci.org/docker-java/docker-java)
# docker-java

Java API client for [Docker](http://docs.docker.io/ "Docker")

Supports a subset of the Docker Client API v1.14, Docker Server version 1.2.0
Supports a subset of the Docker Client API v1.15, Docker Server version 1.3.0

<b>The current implementation is based on Jersey 2.x and therefore classpath incompatible with older Jersey 1.x dependent libraries!</b>

Developer forum for [docker-java](https://groups.google.com/forum/?hl=de#!forum/docker-java-dev "docker-java")

## Build with Maven

###### Prerequisites:

* Java 1.6+
* Java 1.6
* Maven 3.0.5
* Docker daemon running

Maven may run tests during build process but tests are disabled by default. The tests are using a localhost instance of Docker, make sure that you have Docker running for tests to work. To run the tests you have to provide your https://www.docker.io/account/login/ information:
If you need SSL, then you'll need to put your `*.pem` file into `~/.docker/`, if you're using boot2docker, do this:

$ ln -s /Users/alex.collins/.boot2docker/certs/boot2docker-vm .docker

Build and run integration tests as follows:

$ mvn clean install

$ mvn clean install -DskipTests=false -Ddocker.io.username=... -Ddocker.io.password=... -Ddocker.io.email=...
If you do not have access to a Docker server or just want to execute the build quickly, you can run the build without the integration tests:

$ mvn clean install -DskipITs

By default Docker server is using UNIX sockets for communication with the Docker client, however docker-java
client uses TCP/IP to connect to the Docker server, so you will need to make sure that your Docker server is
listening on TCP port. To allow Docker server to use TCP add the following line to /etc/default/docker

DOCKER_OPTS="-H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock"

More details setting up docket server can be found in official documentation: http://docs.docker.io/en/latest/use/basics/
More details setting up Docker server can be found in official documentation: http://docs.docker.io/en/latest/use/basics/

Now make sure that docker is up:

Expand All @@ -37,9 +48,9 @@ Now make sure that docker is up:
Git commit (server): fa7b24f
Go version (server): go1.3.1

Run build with tests:
Run build without integration tests:

$ mvn clean install -DskipTests=false
$ mvn clean install -DskipITs

## Docker-Java maven dependencies

Expand All @@ -48,19 +59,17 @@ Run build with tests:
<dependency>
<groupId>com.github.docker-java</groupId>
<artifactId>docker-java</artifactId>
<version>0.10.1</version>
<version>0.10.3</version>
</dependency>

### Latest SNAPSHOT version

<dependency>
<groupId>com.github.docker-java</groupId>
<artifactId>docker-java</artifactId>
<version>0.10.2-SNAPSHOT</version>
<version>0.10.4-SNAPSHOT</version>
</dependency>

Latest SNAPSHOT is published to maven repo: https://oss.sonatype.org/content/groups/public via ![Build on CloudBees](http://cloudbees.prod.acquia-sites.com/sites/default/files/styles/large/public/Button-Powered-by-CB.png?itok=uMDWINfY)

## Documentation

For code examples, please look at the [Wiki](https://github.com/docker-java/docker-java/wiki) or [Test cases](https://github.com/docker-java/docker-java/tree/master/src/test/java/com/github/dockerjava/core/command "Test cases")
Expand All @@ -69,38 +78,56 @@ For code examples, please look at the [Wiki](https://github.com/docker-java/dock

There are a couple of configuration items, all of which have sensible defaults:

* `url` The Docker URL, e.g. `http://localhost:2375`.
* `version` The API version, e.g. `1.14`.
* `username` Your repository username (required to push containers).
* `password` Your repository password.
* `email` Your repository email.
* `url` The Docker URL, e.g. `https://localhost:2376`.
* `version` The API version, e.g. `1.15`.
* `username` Your registry username (required to push containers).
* `password` Your registry password.
* `email` Your registry email.
* `serverAddress` Your registry's address.
* `dockerCertPath` Path to the docker certs.

There are three ways to configure, in descending order of precedence:

##### Programatic:
#### Programmatic:
In your application, e.g.

DockerClientConfigBuilder configBuilder = DockerClientConfig.createDefaultConfigBuilder();
configBuilder.withVersion("1.14");
configBuilder.withUri("http://my-docker-host.tld:2375");
configBuilder.withUsername("dockeruser");
configBuilder.withPassword("ilovedocker");
configBuilder.withEmail("[email protected]");
DockerClientConfig config = configBuilder.build();
DockerClientConfig config = DockerClientConfig.createDefaultConfigBuilder()
.withVersion("1.15")
.withUri("https://my-docker-host.tld:2376")
.withUsername("dockeruser")
.withPassword("ilovedocker")
.withEmail("[email protected]")
.withServerAddress("https://index.docker.io/v1/")
.withDockerCertPath("/home/user/.docker")
.build();
DockerClient docker = DockerClientBuilder.getInstance(config).build();

#### Properties

docker.io.url=https://localhost:2376
docker.io.version=1.15
docker.io.username=dockeruser
docker.io.password=ilovedocker
[email protected]
docker.io.serverAddress=https://index.docker.io/v1/
docker.io.dockerCertPath=/home/user/.docker


##### System Properties:
E.g.

java -Ddocker.io.username=kpelykh pkg.Main
java -Ddocker.io.username=dockeruser pkg.Main

##### System Environment

export DOCKER_URL=http://localhost:2376

Note: we also auto-detect defaults. If you use `DOCKER_HOST` we use that value, and if `DOCKER_CERT_PATH` is set, we switch to SSL.

##### File System
In `$HOME/.docker.io.properties`, e.g.:

docker.io.username=dockeruser
In `$HOME/.docker.io.properties`

##### Class Path
In the class path at `/docker.io.properties`, e.g.:

docker.io.url=http://localhost:2375
docker.io.version=1.13
In the class path at `/docker.io.properties`

Loading

0 comments on commit 7d2bbfe

Please sign in to comment.