Compare commits

...

13 Commits

Author SHA1 Message Date
29fcd5dfae Merge pull request #81 from andrewhsu/cl
cherry-pick update rpm changelog
2017-06-15 02:46:13 -07:00
9600fb4e78 update rpm changelog
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
(cherry picked from commit 659d6015b6bf8ec3c24cf5377f3eda88beed0a10)
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2017-06-15 09:44:20 +00:00
0f80f28c1a Merge pull request #80 from andrewhsu/rc4
bump VERSION files to 17.06.0-ce-rc4
2017-06-15 01:18:13 -07:00
29e7f7b8c9 bump VERSION files to 17.06.0-ce-rc4
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2017-06-15 08:17:14 +00:00
4c2cf22362 Merge pull request #79 from andrewhsu/systemd
cherry-pick Add systemd scripts
2017-06-15 01:13:42 -07:00
afcb08cfb0 Use internal systemd scripts for DEB packaging
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit 477d0b1f735f7e243425cd2c5f48e8f216556c2f)
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2017-06-15 08:10:46 +00:00
46a9d6b041 Use internal systemd scripts for RPM packaging
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit cbfe576e680b19c5f4c992e52bee59f2bc540026)
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2017-06-15 08:10:33 +00:00
b8c7116a23 Add initial systemd scripts
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit 7b31f87ffd8115f8226f68b788f5b36db53981f6)
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2017-06-15 08:10:17 +00:00
b089783b38 Merge pull request #76 from andrewhsu/pool
cherry-pick container/stream/attach: use pools.Copy
2017-06-14 11:35:08 -07:00
605ffe91cf Merge pull request #75 from aaronlehmann/vendor-swarmkit-bf9b892
Vendor swarmkit bf9b892
2017-06-13 23:23:05 -07:00
eb837fd7bc pkg/pools: add buffer32KPool & use it for copy
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
(cherry picked from commit ba40f4593f79a653f1e3a8b9597b7900fb68a564)
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2017-06-14 00:20:13 +00:00
475c218fd7 container/stream/attach: use pools.Copy
The use of pools.Copy avoids io.Copy's internal buffer allocation.
This commit replaces io.Copy with pools.Copy to avoid the allocation of
buffers in io.Copy.

Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
(cherry picked from commit 014095e6a07748d0e1ce2f759f5c4f4b3783e765)
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2017-06-14 00:20:13 +00:00
f2eb8b825b Vendor swarmkit bf9b892
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-06-13 11:37:41 -07:00
19 changed files with 183 additions and 32 deletions

View File

@ -1 +1 @@
17.06.0-ce-rc3
17.06.0-ce-rc4

View File

@ -1 +1 @@
17.06.0-ce-rc3
17.06.0-ce-rc4

View File

@ -1 +1 @@
17.06.0-ce-rc3
17.06.0-ce-rc4

View File

@ -7,6 +7,7 @@ import (
"golang.org/x/net/context"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/pkg/pools"
"github.com/docker/docker/pkg/promise"
"github.com/docker/docker/pkg/term"
)
@ -86,7 +87,7 @@ func (c *Config) CopyStreams(ctx context.Context, cfg *AttachConfig) chan error
if cfg.TTY {
_, err = copyEscapable(cfg.CStdin, cfg.Stdin, cfg.DetachKeys)
} else {
_, err = io.Copy(cfg.CStdin, cfg.Stdin)
_, err = pools.Copy(cfg.CStdin, cfg.Stdin)
}
if err == io.ErrClosedPipe {
err = nil
@ -116,7 +117,7 @@ func (c *Config) CopyStreams(ctx context.Context, cfg *AttachConfig) chan error
}
logrus.Debugf("attach: %s: begin", name)
_, err := io.Copy(stream, streamPipe)
_, err := pools.Copy(stream, streamPipe)
if err == io.ErrClosedPipe {
err = nil
}
@ -174,5 +175,5 @@ func copyEscapable(dst io.Writer, src io.ReadCloser, keys []byte) (written int64
pr := term.NewEscapeProxy(src, keys)
defer src.Close()
return io.Copy(dst, pr)
return pools.Copy(dst, pr)
}

View File

@ -17,15 +17,16 @@ import (
"github.com/docker/docker/pkg/ioutils"
)
const buffer32K = 32 * 1024
var (
// BufioReader32KPool is a pool which returns bufio.Reader with a 32K buffer.
BufioReader32KPool = newBufioReaderPoolWithSize(buffer32K)
// BufioWriter32KPool is a pool which returns bufio.Writer with a 32K buffer.
BufioWriter32KPool = newBufioWriterPoolWithSize(buffer32K)
buffer32KPool = newBufferPoolWithSize(buffer32K)
)
const buffer32K = 32 * 1024
// BufioReaderPool is a bufio reader that uses sync.Pool.
type BufioReaderPool struct {
pool sync.Pool
@ -54,11 +55,31 @@ func (bufPool *BufioReaderPool) Put(b *bufio.Reader) {
bufPool.pool.Put(b)
}
type bufferPool struct {
pool sync.Pool
}
func newBufferPoolWithSize(size int) *bufferPool {
return &bufferPool{
pool: sync.Pool{
New: func() interface{} { return make([]byte, size) },
},
}
}
func (bp *bufferPool) Get() []byte {
return bp.pool.Get().([]byte)
}
func (bp *bufferPool) Put(b []byte) {
bp.pool.Put(b)
}
// Copy is a convenience wrapper which uses a buffer to avoid allocation in io.Copy.
func Copy(dst io.Writer, src io.Reader) (written int64, err error) {
buf := BufioReader32KPool.Get(src)
written, err = io.Copy(dst, buf)
BufioReader32KPool.Put(buf)
buf := buffer32KPool.Get()
written, err = io.CopyBuffer(dst, src, buf)
buffer32KPool.Put(buf)
return
}

View File

@ -159,3 +159,8 @@ func TestNewWriteCloserWrapperWithAWriteCloser(t *testing.T) {
t.Fatalf("The ReaderCloser should have been closed, it is not.")
}
}
func TestBufferPoolPutAndGet(t *testing.T) {
buf := buffer32KPool.Get()
buffer32KPool.Put(buf)
}

View File

@ -107,7 +107,7 @@ github.com/containerd/containerd cfb82a876ecc11b5ca0977d1733adbe58599088a
github.com/tonistiigi/fifo 1405643975692217d6720f8b54aeee1bf2cd5cf4
# cluster
github.com/docker/swarmkit 6083c7689ed00a6f2d67941443603df69c2ff6ba
github.com/docker/swarmkit bf9b892c0b27bb3e13195bcef4d964fce2987bf1
github.com/gogo/protobuf v0.4
github.com/cloudflare/cfssl 7fb22c8cba7ecaf98e4082d22d65800cf45e042a
github.com/google/certificate-transparency d90e65c3a07988180c5b1ece71791c0b6506826e

View File

@ -152,6 +152,10 @@ func (na *NetworkAllocator) Allocate(n *api.Network) error {
n.DriverState = &api.Driver{
Name: d.name,
}
// In order to support backward compatibility with older daemon
// versions which assumes the network attachment to contains
// non nil IPAM attribute, passing an empty object
n.IPAM = &api.IPAMOptions{Driver: &api.Driver{}}
} else {
nw.pools, err = na.allocatePools(n)
if err != nil {

View File

@ -945,18 +945,19 @@ func (m *Manager) becomeLeader(ctx context.Context) {
if err := store.CreateNetwork(tx, newIngressNetwork()); err != nil {
log.G(ctx).WithError(err).Error("failed to create default ingress network")
}
// Create now the static predefined node-local networks which
// are known to be present in each cluster node. This is needed
// in order to allow running services on the predefined docker
// networks like `bridge` and `host`.
log.G(ctx).Info("Creating node-local predefined networks")
for _, p := range networkallocator.PredefinedNetworks() {
}
// Create now the static predefined if the store does not contain predefined
//networks like bridge/host node-local networks which
// are known to be present in each cluster node. This is needed
// in order to allow running services on the predefined docker
// networks like `bridge` and `host`.
for _, p := range networkallocator.PredefinedNetworks() {
if store.GetNetwork(tx, p.Name) == nil {
if err := store.CreateNetwork(tx, newPredefinedNetwork(p.Name, p.Driver)); err != nil {
log.G(ctx).WithError(err).Error("failed to create predefined network " + p.Name)
}
}
}
return nil
})

View File

@ -31,6 +31,7 @@ ubuntu-xenial: ## build ubuntu xenial deb packages
-v $(CURDIR)/debbuild/$@:/build \
-v $(ENGINE_DIR):/engine \
-v $(CLI_DIR):/cli \
-v $(CURDIR)/systemd:/root/build-deb/systemd \
debbuild-$@/$(ARCH)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
@ -42,6 +43,7 @@ ubuntu-trusty: ## build ubuntu trusty deb packages
-v $(CURDIR)/debbuild/$@:/build \
-v $(ENGINE_DIR):/engine \
-v $(CLI_DIR):/cli \
-v $(CURDIR)/systemd:/root/build-deb/systemd \
debbuild-$@/$(ARCH)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
@ -53,6 +55,7 @@ ubuntu-yakkety: ## build ubuntu yakkety deb packages
-v $(CURDIR)/debbuild/$@:/build \
-v $(ENGINE_DIR):/engine \
-v $(CLI_DIR):/cli \
-v $(CURDIR)/systemd:/root/build-deb/systemd \
debbuild-$@/$(ARCH)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
@ -64,6 +67,7 @@ ubuntu-zesty: ## build ubuntu zesty deb packages
-v $(CURDIR)/debbuild/$@:/build \
-v $(ENGINE_DIR):/engine \
-v $(CLI_DIR):/cli \
-v $(CURDIR)/systemd:/root/build-deb/systemd \
debbuild-$@/$(ARCH)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
@ -75,6 +79,7 @@ debian-jessie: ## build debian jessie deb packages
-v $(CURDIR)/debbuild/$@:/build \
-v $(ENGINE_DIR):/engine \
-v $(CLI_DIR):/cli \
-v $(CURDIR)/systemd:/root/build-deb/systemd \
debbuild-$@/$(ARCH)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
@ -86,6 +91,7 @@ debian-stretch: ## build debian stretch deb packages
-v $(CURDIR)/debbuild/$@:/build \
-v $(ENGINE_DIR):/engine \
-v $(CLI_DIR):/cli \
-v $(CURDIR)/systemd:/root/build-deb/systemd \
debbuild-$@/$(ARCH)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
@ -97,5 +103,6 @@ debian-wheezy: ## build debian wheezy deb packages
-v $(CURDIR)/debbuild/$@:/build \
-v $(ENGINE_DIR):/engine \
-v $(CLI_DIR):/cli \
-v $(CURDIR)/systemd:/root/build-deb/systemd \
debbuild-$@/$(ARCH)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@

View File

@ -5,8 +5,8 @@ engine/contrib/*-integration usr/share/docker-ce/contrib/
engine/contrib/check-config.sh usr/share/docker-ce/contrib/
engine/contrib/completion/fish/docker.fish usr/share/fish/vendor_completions.d/
engine/contrib/completion/zsh/_docker usr/share/zsh/vendor-completions/
engine/contrib/init/systemd/docker.service lib/systemd/system/
engine/contrib/init/systemd/docker.socket lib/systemd/system/
systemd/docker.service lib/systemd/system/
systemd/docker.socket lib/systemd/system/
engine/contrib/mk* usr/share/docker-ce/contrib/
engine/contrib/nuke-graph-directory.sh usr/share/docker-ce/contrib/
engine/contrib/syntax/nano/Dockerfile.nanorc usr/share/nano/

View File

@ -0,0 +1,34 @@
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target docker.socket firewalld.service
Wants=network-online.target
Requires=docker.socket
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H fd://
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=1048576
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,12 @@
[Unit]
Description=Docker Socket for the API
PartOf=docker.service
[Socket]
ListenStream=/var/run/docker.sock
SocketMode=0660
SocketUser=root
SocketGroup=docker
[Install]
WantedBy=sockets.target

View File

@ -11,7 +11,8 @@ RPMBUILD=docker run --privileged --rm -i \
-v $(CURDIR)/rpmbuild/BUILD:/root/rpmbuild/BUILD \
-v $(CURDIR)/rpmbuild/BUILDROOT:/root/rpmbuild/BUILDROOT \
-v $(CURDIR)/rpmbuild/RPMS:/root/rpmbuild/RPMS \
-v $(CURDIR)/rpmbuild/SRPMS:/root/rpmbuild/SRPMS
-v $(CURDIR)/rpmbuild/SRPMS:/root/rpmbuild/SRPMS \
-v $(CURDIR)/systemd:/systemd
RPMBUILD_FLAGS=-ba\
--define '_gitcommit $(word 3,$(GEN_RPM_VER))' \
--define '_release $(word 2,$(GEN_RPM_VER))' \

View File

@ -95,7 +95,7 @@ install -p -m 644 engine/contrib/udev/80-docker.rules $RPM_BUILD_ROOT/%{_sysconf
install -d $RPM_BUILD_ROOT/etc/sysconfig
install -d $RPM_BUILD_ROOT/%{_initddir}
install -d $RPM_BUILD_ROOT/%{_unitdir}
install -p -m 644 engine/contrib/init/systemd/docker.service.rpm $RPM_BUILD_ROOT/%{_unitdir}/docker.service
install -p -m 644 /systemd/docker.service $RPM_BUILD_ROOT/%{_unitdir}/docker.service
# add bash, zsh, and fish completions
install -d $RPM_BUILD_ROOT/usr/share/bash-completion/completions
install -d $RPM_BUILD_ROOT/usr/share/zsh/vendor-completions
@ -163,5 +163,14 @@ fi
%changelog
* Wed May 10 2017 <andrewhsu@docker.com> 17.06.0-dev
- Initial RPM release
* Thu Jun 15 2017 <andrewhsu@docker.com> 17.06.0-ce-rc4
- release docker-ce 17.06.0-ce-rc4
* Tue Jun 13 2017 <andrewhsu@docker.com> 17.06.0-ce-rc3
- release docker-ce 17.06.0-ce-rc3
* Wed Jun 07 2017 <andrewhsu@docker.com> 17.06.0-ce-rc2
- release docker-ce 17.06.0-ce-rc2
* Mon May 29 2017 <andrewhsu@docker.com> 17.06.0-ce-rc1
- release docker-ce 17.06.0-ce-rc1

View File

@ -95,7 +95,7 @@ install -p -m 644 engine/contrib/udev/80-docker.rules $RPM_BUILD_ROOT/%{_sysconf
install -d $RPM_BUILD_ROOT/etc/sysconfig
install -d $RPM_BUILD_ROOT/%{_initddir}
install -d $RPM_BUILD_ROOT/%{_unitdir}
install -p -m 644 engine/contrib/init/systemd/docker.service.rpm $RPM_BUILD_ROOT/%{_unitdir}/docker.service
install -p -m 644 /systemd/docker.service $RPM_BUILD_ROOT/%{_unitdir}/docker.service
# add bash, zsh, and fish completions
install -d $RPM_BUILD_ROOT/usr/share/bash-completion/completions
install -d $RPM_BUILD_ROOT/usr/share/zsh/vendor-completions
@ -163,5 +163,14 @@ fi
%changelog
* Wed May 10 2017 <andrewhsu@docker.com> 17.06.0-dev
- Initial RPM release
* Thu Jun 15 2017 <andrewhsu@docker.com> 17.06.0-ce-rc4
- release docker-ce 17.06.0-ce-rc4
* Tue Jun 13 2017 <andrewhsu@docker.com> 17.06.0-ce-rc3
- release docker-ce 17.06.0-ce-rc3
* Wed Jun 07 2017 <andrewhsu@docker.com> 17.06.0-ce-rc2
- release docker-ce 17.06.0-ce-rc2
* Mon May 29 2017 <andrewhsu@docker.com> 17.06.0-ce-rc1
- release docker-ce 17.06.0-ce-rc1

View File

@ -94,7 +94,7 @@ install -p -m 644 engine/contrib/udev/80-docker.rules $RPM_BUILD_ROOT/%{_sysconf
install -d $RPM_BUILD_ROOT/etc/sysconfig
install -d $RPM_BUILD_ROOT/%{_initddir}
install -d $RPM_BUILD_ROOT/%{_unitdir}
install -p -m 644 engine/contrib/init/systemd/docker.service.rpm $RPM_BUILD_ROOT/%{_unitdir}/docker.service
install -p -m 644 /systemd/docker.service $RPM_BUILD_ROOT/%{_unitdir}/docker.service
# add bash, zsh, and fish completions
install -d $RPM_BUILD_ROOT/usr/share/bash-completion/completions
install -d $RPM_BUILD_ROOT/usr/share/zsh/vendor-completions
@ -162,5 +162,14 @@ fi
%changelog
* Wed May 10 2017 <andrewhsu@docker.com> 17.06.0-dev
- Initial RPM release
* Thu Jun 15 2017 <andrewhsu@docker.com> 17.06.0-ce-rc4
- release docker-ce 17.06.0-ce-rc4
* Tue Jun 13 2017 <andrewhsu@docker.com> 17.06.0-ce-rc3
- release docker-ce 17.06.0-ce-rc3
* Wed Jun 07 2017 <andrewhsu@docker.com> 17.06.0-ce-rc2
- release docker-ce 17.06.0-ce-rc2
* Mon May 29 2017 <andrewhsu@docker.com> 17.06.0-ce-rc1
- release docker-ce 17.06.0-ce-rc1

View File

@ -5,6 +5,11 @@ VERSION=$2
[[ $# < 2 ]] && echo 'not enough args' && exit 1
DATE_COMMAND="date"
if [[ $(uname) -eq "Darwin" ]]; then
DATE_COMMAND="docker run --rm alpine date"
fi
GIT_COMMAND="git -C $ENGINE_DIR"
rpmName=docker-ce
rpmVersion="$VERSION"
@ -32,7 +37,7 @@ fi
# if we have a "-dev" suffix or have change in Git, let's make this package version more complex so it works better
if [[ "$rpmVersion" == *-dev ]] || [ -n "$($GIT_COMMAND status --porcelain)" ]; then
gitUnix="$($GIT_COMMAND log -1 --pretty='%at')"
gitDate="$(date --date "@$gitUnix" +'%Y%m%d.%H%M%S')"
gitDate="$($DATE_COMMAND --date "@$gitUnix" +'%Y%m%d.%H%M%S')"
gitCommit="$($GIT_COMMAND log -1 --pretty='%h')"
gitVersion="${gitDate}.git${gitCommit}"
# gitVersion is now something like '20150128.112847.17e840a'

View File

@ -0,0 +1,33 @@
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target