Commit graph

1800 commits

Author SHA1 Message Date
Tonis Tiigi
45727cd177 Fix opq whiteouts problems for files with dot prefix
Fixes #17766

Previously, opaque directory whiteouts on non-native
graphdrivers depended on the file order, meaning
files added with the same layer before the whiteout
file `.wh..wh..opq` were also removed.

If that file happened to have subdirs, then calling
chtimes on those dirs after unpack would fail the pull.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-11-08 23:00:01 -08:00
Alexander Morozov
a3fda8ecf8 Merge pull request #17185 from cpuguy83/use_finer_locking_for_volume_store
Fix potential races in the volume store
2015-11-06 08:48:12 -08:00
David Calavera
5ecd79236b Merge pull request #16692 from vdemeester/16690-fix-etc-osrelease-panic
Fix panic in parsing /etc/os-release
2015-11-05 15:11:02 -08:00
Stefan J. Wernli
9e0fb3e0c7 Fixing last access time on Windows to unblock python.
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2015-11-05 12:15:18 -08:00
Jess Frazelle
7db6517c81 Merge pull request #17677 from fboudra/master
Remove yum cache to reduce image size
2015-11-05 11:16:40 -08:00
Vincent Demeester
bffb7509bb Fix panic in parsing /etc/os-release
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-11-05 19:59:29 +01:00
Brian Goff
2d5e8bce1c Fallback to file polling for jsonlog reader on err
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-11-05 10:05:05 -05:00
Sebastiaan van Stijn
55c8a5b21b Merge pull request #14012 from sallyom/exitCodes
Change 'docker run' exit codes to distinguish docker/contained errors
2015-11-05 00:50:08 +01:00
Brian Goff
1a5bee6025 Fix potential races in the volume store
Uses finer grained locking so that each volume name gets its own lock
rather than only being protected by the global lock, which itself needs
to be unlocked during cetain operations (`create` especially`)

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-11-04 16:59:47 -05:00
Sally O'Malley
e94c4801a6 Change 'docker run' exit codes to distinguish docker/contained errors
The purpose of this PR is for users to distinguish Docker errors from
contained command errors.
This PR modifies 'docker run' exit codes to follow the chroot standard
for exit codes.
Exit status:
125 if 'docker run' itself fails
126 if contained command cannot be invoked
127 if contained command cannot be found
the exit status otherwise

Signed-off-by: Sally O'Malley <somalley@redhat.com>
2015-11-04 15:18:50 -05:00
Alexander Morozov
ac6d5a4f39 Do not rely on string comparison in truncindex
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-11-04 11:34:05 -08:00
Brian Goff
4cc2eda471 Merge pull request #17630 from LK4D4/syscall_umount_warn
Do not ignore error from syscall.Unmount
2015-11-03 19:58:19 -05:00
Peter Malmgren
39e1568228 Fix docker status incorrectly reports containerized. Fixes #17037
Signed-off-by: Peter Malmgren <ptmalmgren@gmail.com>
2015-11-04 00:08:46 +00:00
Jess Frazelle
9f0f24ea63 Merge pull request #17614 from LK4D4/fix_golint
Update linting tools to latest versions
2015-11-03 15:32:12 -08:00
Stephen J Day
c02491b8c3 Avoid panic on write after close in http
By adding a (*WriteFlusher).Close, we limit the Write calls to possibly
deallocated http response buffers to the lifetime of an http request.
Typically, this is seen as a very confusing panic, the cause is usually a
situation where an http.ResponseWriter is held after request completion. We
avoid the panic by disallowing further writes to the response writer after the
request is completed.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-11-02 18:14:43 -08:00
David Calavera
4ceddc01e6 Merge pull request #17628 from LK4D4/umount_log_err
Log error from unmountVolumes on cleanup
2015-11-02 15:38:32 -08:00
Alexander Morozov
9078de5cb5 Do not ignore error from syscall.Unmount
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-11-02 14:40:29 -08:00
David Calavera
04ee01b8d6 Merge pull request #17573 from Microsoft/10662-parsersos
Windows: Fix unit tests parsers\os
2015-11-02 14:31:09 -08:00
Alexander Morozov
7765d17a84 Log error from unmountVolumes on cleanup
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-11-02 14:11:42 -08:00
John Howard
2ded2d1dd4 Windows: Fix unit tests parsers\os
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-11-02 11:28:47 -08:00
Alexander Morozov
b4d2f061be Fix go vet warnings
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-11-02 08:28:34 -08:00
Alexander Morozov
14396c9092 Fix golint warnings
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-11-02 08:02:25 -08:00
John Howard
e37f5839e8 Windows: Fix parsers kernel test
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-11-01 07:05:16 -08:00
John Howard
7b3e897b0b Windows: Native ANSI console support
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-30 13:44:04 -07:00
Roma Sokolov
4d715395e6 Add newlines to FormatProgress for JSON as well
Commit 060da572d20dfeee4fe02ce6b975a6cb33e50dbe has introduced newlines
to streamformatter to help parse Remote API responses. However,
FormatProgress method was omitted from the list of patched methods,
leaving progress messages in, say, /images/create without newlines.

Signed-off-by: Roma Sokolov <sokolov.r.v@gmail.com>
2015-10-28 12:58:47 +00:00
Jess Frazelle
be7bdc5be2 Merge pull request #17418 from diogomonica/bump-go-1.5
Bump go 1.5
2015-10-27 20:12:43 -07:00
Jessica Frazelle
bb4582aea6 update to binaries, fix parsers package, non-parallel test unit
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-10-27 14:43:25 -07:00
Alexandre Beslic
41daee630a Merge pull request #17364 from mavenugo/advertise
Enhancing --cluster-advertise to support <interface-name>
2015-10-27 13:29:18 -07:00
Madhu Venugopal
317a486d5c Enhancing --cluster-advertise to support <interface-name>
--cluster-advertise daemon option is enahanced to support <interface-name>
in addition to <ip-address> in order to amke it  automation friendly using
docker-machine.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-27 11:03:22 -07:00
John Howard
cc1bd6eec5 Windows: Volumes PR fix one of Tibors nits
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-26 13:34:49 -07:00
David Calavera
c5accd5c91 Merge pull request #17286 from FeroVolar/namegenerator
Add Heyrovsky
2015-10-26 13:26:43 -07:00
Fero Volar
390c3f6590 Add Bassi
Signed-off-by: Fero Volar <alian@alian.info>
2015-10-23 01:32:47 +02:00
Fero Volar
33aaf1ac3b Add Heyrovsky
Signed-off-by: Fero Volar <alian@alian.info>
2015-10-23 01:01:58 +02:00
John Howard
e0069700ad Windows: Add volume support
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-22 10:42:53 -07:00
Tibor Vass
bf04de9ef4 Merge pull request #16940 from coolljt0725/default_tls_host
Make default tls host work
2015-10-21 14:02:22 -04:00
Alexander Morozov
795370d737 Merge pull request #17035 from estesp/fix-build-dir-perms
Correct build-time directory creation with user namespaced daemon
2015-10-20 08:57:19 -07:00
Phil Estes
e8282c4e9d Correct build-time directory creation with user namespaced daemon
This fixes errors in ownership on directory creation during build that
can cause inaccessible files depending on the paths in the Dockerfile
and non-existing directories in the starting image.

Add tests for the mkdir variants in pkg/idtools

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-10-20 08:59:48 -04:00
Jess Frazelle
a45713d529 Merge pull request #17088 from Microsoft/sjw/archive_hang_fix
Fixing hang in archive.CopyFileWithTar with invalid dst
2015-10-19 17:18:25 -07:00
Stefan J. Wernli
f05813a1ea Fixing hang in archive.CopyWithTar with invalid dst
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2015-10-19 11:56:05 -07:00
Lei Jitang
6159d85e26 Make default tls host work
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-10-19 21:17:37 +08:00
Jan-Gerd Tenberge
2e3a391376 Fix spelling error, add Noether and Euler
Signed-off-by: Jan-Gerd Tenberge <janten@gmail.com>
2015-10-19 01:14:39 +02:00
3cd97bbcb0 Merge pull request #16960 from pydima/9283_consider_hard_links_in_image_size
Consider hardlinks in image size.
2015-10-17 14:22:33 -04:00
Sebastiaan van Stijn
66d082cec7 Merge pull request #17056 from vdemeester/16756-integration-cli-checkers-api-build
Vendoring new go-check checkers and use checker for docker_api_build_test.go
2015-10-17 08:50:51 -07:00
Vincent Demeester
4538373791 Vendoring shakers library and update go-check
The shakers library defines a bunch of go-check checkers to ease
writing tests.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-10-17 14:28:08 +02:00
Dmitry Vorobev
f6ec5ae6ee Fixes #9283. Consider hardlinks in image size.
Based on #8984. This patch fixes behavior when image size calculation
didn't consider hardlinks.

Signed-off-by: Dmitry Vorobev <dimahabr@gmail.com>
2015-10-17 12:24:05 +02:00
Antonio Murdaca
bc78380707 Merge pull request #16950 from cpuguy83/support_ipv6_in_host_parser
Allow API to bind to ipv6 addresses
2015-10-17 00:20:49 +02:00
9158522b8a Merge pull request #16932 from c0b/fix-race-16924
Fix race #16924 [panic: runtime error: slice bounds out of range] docker daemon crash of racing
2015-10-15 18:05:05 -05:00
John Howard
a81f89aa9d Windows: [TP4] docker kill handling
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-13 16:04:49 -07:00
Derek Ch
c45a95b9c0 fix a race crash when building with "ADD some-broken.tar.xz ..."
The race is between pools.Put which calls buf.Reset and exec.Cmd
doing io.Copy from the buffer; it caused a runtime crash, as
described in #16924:

``` docker-daemon cat the-tarball.xz | xz -d -c -q | docker-untar /path/to/... (aufs ) ```

When docker-untar side fails (like try to set xattr on aufs, or a broken
tar), invokeUnpack will be responsible to exhaust all input, otherwise
`xz` will be write pending for ever.

this change add a receive only channel to cmdStream, and will close it
to notify it's now safe to close the input stream;

in CmdStream the change to use Stdin / Stdout / Stderr keeps the
code simple, os/exec.Cmd will spawn goroutines and call io.Copy automatically.

the CmdStream is actually called in the same file only, change it
lowercase to mark as private.

[...]
INFO[0000] Docker daemon                                 commit=0a8c2e3 execdriver=native-0.2 graphdriver=aufs version=1.8.2

DEBU[0006] Calling POST /build
INFO[0006] POST /v1.20/build?cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&memory=0&memswap=0&rm=1&t=gentoo-x32&ulimits=null
DEBU[0008] [BUILDER] Cache miss
DEBU[0009] Couldn't untar /home/lib-docker-v1.8.2-tmp/tmp/docker-build316710953/stage3-x32-20151004.tar.xz to /home/lib-docker-v1.8.2-tmp/aufs/mnt/d909abb87150463939c13e8a349b889a72d9b14f0cfcab42a8711979be285537: Untar re-exec error: exit status 1: output: operation not supported
DEBU[0009] CopyFileWithTar(/home/lib-docker-v1.8.2-tmp/tmp/docker-build316710953/stage3-x32-20151004.tar.xz, /home/lib-docker-v1.8.2-tmp/aufs/mnt/d909abb87150463939c13e8a349b889a72d9b14f0cfcab42a8711979be285537/)
panic: runtime error: slice bounds out of range

goroutine 42 [running]:
bufio.(*Reader).fill(0xc208187800)
    /usr/local/go/src/bufio/bufio.go:86 +0x2db
bufio.(*Reader).WriteTo(0xc208187800, 0x7ff39602d150, 0xc2083f11a0, 0x508000, 0x0, 0x0)
    /usr/local/go/src/bufio/bufio.go:449 +0x27e
io.Copy(0x7ff39602d150, 0xc2083f11a0, 0x7ff3960261f8, 0xc208187800, 0x0, 0x0, 0x0)
    /usr/local/go/src/io/io.go:354 +0xb2
github.com/docker/docker/pkg/archive.func·006()
    /go/src/github.com/docker/docker/pkg/archive/archive.go:817 +0x71
created by github.com/docker/docker/pkg/archive.CmdStream
    /go/src/github.com/docker/docker/pkg/archive/archive.go:819 +0x1ec

goroutine 1 [chan receive]:
main.(*DaemonCli).CmdDaemon(0xc20809da30, 0xc20800a020, 0xd, 0xd, 0x0, 0x0)
    /go/src/github.com/docker/docker/docker/daemon.go:289 +0x1781
reflect.callMethod(0xc208140090, 0xc20828fce0)
    /usr/local/go/src/reflect/value.go:605 +0x179
reflect.methodValueCall(0xc20800a020, 0xd, 0xd, 0x1, 0xc208140090, 0x0, 0x0, 0xc208140090, 0x0, 0x45343f, ...)
    /usr/local/go/src/reflect/asm_amd64.s:29 +0x36
github.com/docker/docker/cli.(*Cli).Run(0xc208129fb0, 0xc20800a010, 0xe, 0xe, 0x0, 0x0)
    /go/src/github.com/docker/docker/cli/cli.go:89 +0x38e
main.main()
    /go/src/github.com/docker/docker/docker/docker.go:69 +0x428

goroutine 5 [syscall]:
os/signal.loop()
    /usr/local/go/src/os/signal/signal_unix.go:21 +0x1f
created by os/signal.init·1
    /usr/local/go/src/os/signal/signal_unix.go:27 +0x35

Signed-off-by: Derek Ch <denc716@gmail.com>
2015-10-13 15:58:06 -07:00
John Howard
831c2e7a7b Windows: Fix AV in build due to userns
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-13 14:02:25 -07:00