X Tutup
Skip to content

Commit a71ac27

Browse files
author
Andy Piper
committed
Merge remote-tracking branch 'docker-java/master'
2 parents 75309ff + fbd1ce1 commit a71ac27

File tree

97 files changed

+3453
-391
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+3453
-391
lines changed

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ target
1212

1313
# Ignore InteliJ Idea project files
1414
.idea
15-
.idea/*
15+
!.idea/codeStyleSettings.xml
16+
!.idea/encodings.xml
1617
*.iml
1718
*.iws
1819
*.ipr
@@ -21,4 +22,5 @@ target
2122
*.log
2223

2324
#Ignore Test Output
24-
test-output
25+
test-output
26+
/.checkstyle

.idea/codeStyleSettings.xml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.travis.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ services:
66
- docker
77

88
jdk:
9-
- oraclejdk7
9+
- oraclejdk8
1010

1111
install: true
1212

1313
env:
1414
global:
15+
- CODECOV=true
1516
- DOCKER_TLS_VERIFY=""
1617
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
1718
# via the "travis encrypt" command using the project repo's public key
@@ -21,12 +22,16 @@ env:
2122
- COVERITY_SCAN_NOTIFICATION_EMAIL="kanstantsin.sha@gmail.com"
2223

2324
matrix:
24-
- repo="main" DOCKER_HOST="tcp://127.0.0.1:2375" DOCKER_VERSION="1.12.0-0~trusty" CODECOV=true
25-
- repo="main" DOCKER_HOST="unix:///var/run/docker.sock" DOCKER_VERSION="1.12.0-0~trusty" CODECOV=true
26-
- repo="main" DOCKER_HOST="tcp://127.0.0.1:2375" DOCKER_VERSION="1.11.2-0~trusty" DEPLOY=true COVERITY=true CODECOV=true
27-
- repo="main" DOCKER_HOST="unix:///var/run/docker.sock" DOCKER_VERSION="1.11.2-0~trusty" CODECOV=true
28-
- repo="main" DOCKER_HOST="tcp://127.0.0.1:2375" DOCKER_VERSION="1.10.3-0~trusty" CODECOV=true
29-
- repo="main" DOCKER_HOST="unix:///var/run/docker.sock" DOCKER_VERSION="1.10.3-0~trusty" CODECOV=true
25+
- repo="main" DOCKER_HOST="tcp://127.0.0.1:2375" DOCKER_VERSION="17.05.0~ce-0~ubuntu-trusty" DEPLOY=true COVERITY=true
26+
- repo="main" DOCKER_HOST="unix:///var/run/docker.sock" DOCKER_VERSION="17.05.0~ce-0~ubuntu-trusty"
27+
- repo="main" DOCKER_HOST="tcp://127.0.0.1:2375" DOCKER_VERSION="1.13.1-0~ubuntu-trusty"
28+
- repo="main" DOCKER_HOST="unix:///var/run/docker.sock" DOCKER_VERSION="1.13.1-0~ubuntu-trusty"
29+
- repo="main" DOCKER_HOST="tcp://127.0.0.1:2375" DOCKER_VERSION="1.12.6-0~ubuntu-trusty"
30+
- repo="main" DOCKER_HOST="unix:///var/run/docker.sock" DOCKER_VERSION="1.12.6-0~ubuntu-trusty"
31+
- repo="main" DOCKER_HOST="tcp://127.0.0.1:2375" DOCKER_VERSION="1.11.2-0~trusty"
32+
- repo="main" DOCKER_HOST="unix:///var/run/docker.sock" DOCKER_VERSION="1.11.2-0~trusty"
33+
- repo="main" DOCKER_HOST="tcp://127.0.0.1:2375" DOCKER_VERSION="1.10.3-0~trusty"
34+
- repo="main" DOCKER_HOST="unix:///var/run/docker.sock" DOCKER_VERSION="1.10.3-0~trusty"
3035
# - repo="testing" DOCKER_HOST="tcp://127.0.0.1:2375"
3136
# - repo="testing" DOCKER_HOST="unix:///var/run/docker.sock"
3237
# - repo="experimental" DOCKER_HOST="tcp://127.0.0.1:2375"
@@ -48,5 +53,5 @@ script:
4853
after_success:
4954
- ./.travis/travis-after-success.sh
5055

51-
after_script:
52-
- sudo cat /var/log/upstart/docker.log
56+
#after_script:
57+
# - sudo cat /var/log/upstart/docker.log

.travis/travis-before-install.sh

Lines changed: 83 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,32 @@
11
#!/usr/bin/env bash
22

3+
SWARM_VERSION="${SWARM_VERSION:-}"
4+
FAST_BUILD="${FAST_BUILD:-}"
35

6+
## fix coverity issue
47
sudo apt-get install -y -q ca-certificates
5-
6-
export HOST_PORT=2375
78
echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt
9+
##
810

9-
10-
if [ "$FAST_BUILD" == true ]; then
11+
if [ "$FAST_BUILD" == "true" ]; then
1112
echo "Fast build, skipping docker installations."
1213
exit 0
1314
fi
1415

1516
set -exu
1617

18+
sudo ip a ls
19+
sudo ip r ls
20+
sudo ss -antpl
21+
22+
export HOST_PORT="2375"
23+
export SWARM_PORT="2377"
24+
export HOST_IP="$(ip a show dev eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)"
25+
# because of swarm use docker-engine directly
26+
export PRE_DOCKER_HOST="$DOCKER_HOST"
27+
export DOCKER_HOST="tcp://127.0.0.1:${HOST_PORT}"
28+
29+
1730
docker info
1831
docker version
1932

@@ -89,3 +102,69 @@ registry.email=${registry_email}
89102
registry.url=https://index.docker.io/v1/
90103
91104
EOF
105+
106+
if [[ -n $SWARM_VERSION ]]; then
107+
# export SWARM_PORT="${PRE_DOCKER_HOST##*:}"
108+
109+
docker pull swarm
110+
111+
# # kv store https://docs.docker.com/v1.11/engine/userguide/networking/get-started-overlay/
112+
# docker run -d \
113+
# -p "8500:8500" \
114+
# -h "consul" \
115+
# --name=consul \
116+
# progrium/consul -server -bootstrap
117+
#
118+
# sleep 5
119+
120+
# SWARM_TOKEN=$(docker run swarm c)
121+
122+
# docker run \
123+
# -d \
124+
# --name=swarm_manager \
125+
# -p ${SWARM_PORT}:2375 \
126+
# "swarm:${SWARM_VERSION}" \
127+
# manage token://${SWARM_TOKEN}
128+
129+
docker run \
130+
-d \
131+
-p ${SWARM_PORT}:2375 \
132+
--name=swarm_manager \
133+
swarm manage --engine-refresh-min-interval "3s" --engine-refresh-max-interval "6s" "nodes://${HOST_IP}:${HOST_PORT}"
134+
# swarm manage --engine-refresh-min-interval "3s" --engine-refresh-max-interval "6s" "consul://${HOST_IP}:8500"
135+
136+
# join engine to swarm
137+
docker run \
138+
-d \
139+
"--name=swarm_join" \
140+
"swarm:${SWARM_VERSION}" \
141+
join --advertise="${HOST_IP}:${HOST_PORT}" --delay="0s" --heartbeat "5s" "nodes://${HOST_IP}:${HOST_PORT}"
142+
# join --advertise="${HOST_IP}:${HOST_PORT}" --delay="0s" --heartbeat "5s" "token://${SWARM_TOKEN}"
143+
144+
docker run --rm \
145+
"swarm:${SWARM_VERSION}" list "nodes://${HOST_IP}:${HOST_PORT}"
146+
147+
docker ps -a
148+
sudo ss -antpl
149+
150+
sleep 30
151+
152+
docker logs swarm_join
153+
docker logs swarm_manager
154+
# docker logs consul
155+
156+
# switch to swarm connection
157+
DOCKER_HOST="$PRE_DOCKER_HOST"
158+
159+
docker version
160+
docker info
161+
162+
NODES=$(docker info | grep "Nodes:" | awk '{ print $2 }')
163+
if [[ $NODES -eq "0" ]]; then
164+
echo "Swarm didn't connect"
165+
exit 1
166+
fi
167+
168+
# test via swarm
169+
docker pull busybox
170+
fi

CHANGELOG.md

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,47 @@
11
Change Log
22
===
3-
## Next
3+
## (dev) 3.1.0 (reserverd for swarm features)
4+
5+
## 3.0.11
6+
- Add labels and attachable properties to network.
7+
- Set default socket timeout for RequestConfig.
8+
- Netty skip instead of throw error on non-linux os.
9+
- Clean tmp file after upload.
10+
- Filters ignore application/x-tar.
11+
- Allow user to call connectionManager's closeIdleConnections.
12+
13+
## 3.0.10
14+
- Support for cache-from in build image command
15+
- Allow multiple tags in build image command
16+
- Custom `db` logging type
17+
- Allow an explicit Dockerfile location string to be specified to theuild command
18+
- Fix image build for docker 17 with 'tagged' word.
19+
20+
## 3.0.9
21+
- NettyDockerCmdExecFactory ignores API version
22+
- exclude commons-logging from httpclient since docker-java uses slf4j/logback
23+
- Generate OSGi compliant manifest
24+
- AuthResponse may contains token.
25+
26+
## 3.0.8
27+
- Use TLSv1.2 by default
28+
- Health api
29+
- Labels
30+
- Support for multiple certificates
31+
32+
## 3.0.7
33+
* https://github.com/docker-java/docker-java/milestone/17?closed=1
34+
* HostConfig pidLimits
35+
* Label image during build
36+
* Expose 'User' property on ExecCreateCmd #707 #708
437

538
## 3.0.6
6-
* Make all models Serializable
39+
* Fixed issue with jersey and unix domain sockets.
40+
* [#703](https://github.com/docker-java/docker-java/pull/703) Allow to configure connection pool timeout.
41+
* Make all models Serializable.
42+
* [NETTY] Fix loadImage responce on 1.24 API.
43+
* LogPath field for inspect container.
44+
* [#700] (https://github.com/docker-java/docker-java/pull/700) Bugfix:donot throw RuntimeException when a error occured in awaitCompletion(long,TimeUnit)
745

846
## 3.0.5
947
* Events updated to 1.24 API model.

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ client also uses UNIX domain sockets to connect to the docker daemon by default.
3838

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

41-
More details about setting up Docker server can be found in official documentation: http://docs.docker.io/en/latest/use/basics/
41+
More details about setting up Docker Engine can be found in the official documentation: https://docs.docker.com/engine/admin/
4242

4343
To force docker-java to use TCP (http) configure the following (see [Configuration](https://github.com/docker-java/docker-java#configuration) for details):
4444

@@ -51,23 +51,24 @@ For secure tls (https) communication:
5151
DOCKER_CERT_PATH=/Users/marcus/.docker/machine/machines/docker-1.11.2
5252

5353
### Latest release version
54-
Supports a subset of the Docker Remote API [v1.23](https://github.com/docker/docker/blob/master/docs/reference/api/docker_remote_api_v1.23.md), Docker Server version 1.11.x
54+
Supports a subset of the Docker Remote API [v1.23](https://github.com/docker/docker/blob/master/docs/api/v1.23.md), Docker Server version 1.11.x
5555

5656
<dependency>
5757
<groupId>com.github.docker-java</groupId>
5858
<artifactId>docker-java</artifactId>
59-
<version>3.0.3</version>
59+
<!-- use latest version https://github.com/docker-java/docker-java/releases -->
60+
<version>3.X.Y</version>
6061
</dependency>
6162

6263
### Latest development version
63-
Supports a subset of the Docker Remote API [v1.23](https://github.com/docker/docker/blob/master/docs/reference/api/docker_remote_api_v1.23.md), Docker Server version 1.11.x
64+
Supports a subset of the Docker Remote API [v1.23](https://github.com/docker/docker/blob/master/docs/api/v1.23.md), Docker Server version 1.11.x
6465

6566
You can find the latest development version including javadoc and source files on [Sonatypes OSS repository](https://oss.sonatype.org/content/groups/public/com/github/docker-java/docker-java/).
6667

6768
<dependency>
6869
<groupId>com.github.docker-java</groupId>
6970
<artifactId>docker-java</artifactId>
70-
<version>3.0.4-SNAPSHOT</version>
71+
<version>3.X.Y-SNAPSHOT</version>
7172
</dependency>
7273

7374

0 commit comments

Comments
 (0)
X Tutup