Commit graph

1037 commits

Author SHA1 Message Date
unclejack
0706016675 pkg/ioutils: add tests for BufReader
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-03-18 19:32:46 +02:00
Andy Goldstein
18332a6073 Add ability to refer to image by name + digest
Add ability to refer to an image by repository name and digest using the
format repository@digest. Works for pull, push, run, build, and rmi.

Signed-off-by: Andy Goldstein <agoldste@redhat.com>
2015-03-17 10:10:42 +00:00
Arnaud Porterie
57ceb4a402 Merge pull request #9882 from ibuildthecloud/labels
Proposal: One Meta Data to Rule Them All => Labels
2015-03-16 20:20:05 -07:00
Jessie Frazelle
8cd2a81fd8 Merge pull request #11420 from estesp/reexec-path-fix
Fix relative path execution of docker daemon in reexec.Self()
2015-03-16 14:57:25 -07:00
Lars Kellogg-Stedman
ef50a94a9c fix various problems with iptables.Exists
This modifies iptables.Exists so that it must be called with an explicit
table and chain.  This allows us (a) to generate an appropriate command
line for "iptables -C", which was not previously possible, and (b) it
allows us to limit our strings.Contains() search to just the table and
chain in question, preventing erroneous matches against unrelated rules.

Resolves #10781

Signed-off-by: Lars Kellogg-Stedman <lars@redhat.com>
2015-03-16 17:14:45 -04:00
Phil Estes
c1642c937d Fix relative path execution of docker daemon in reexec.Self()
After the new libcontainer API, the reexec.Self() output of the daemon
binary is used as the libcontainer factory InitPath.  If it is relative,
it can't be found at container start time.  This patch solves the
problem by making sure that we return a rooted/absolute path if a
relative path is used.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-03-16 16:52:00 -04:00
Alexander Morozov
aa11bf993a Merge pull request #10977 from robertabbott/10959-progressreader
Moves progressreader from utils to its own package
2015-03-16 12:45:33 -07:00
Alexander Morozov
f9b208001f Merge pull request #11323 from delftswa2014/utils-daemon-windows
Make utils_daemon and volumes.go cross-platform compileable (Windows).
2015-03-16 12:14:30 -07:00
Rik Nijessen
a5e54d5788 Make utils_daemon and volumes cross-platform compileable.
Signed-off-by: Rik Nijessen <riknijessen@gmail.com>
2015-03-16 11:46:07 +01:00
Arnaud Porterie
b57fba2430 Merge pull request #11076 from hqhq/hq_use_warning_in_sysinfo
use type WARN for warning
2015-03-15 21:13:23 -07:00
Darren Shepherd
6311ff4ab2 Set labels on container create
Signed-off-by: Darren Shepherd <darren@rancher.com>
2015-03-13 10:02:04 -07:00
Rick Wieman
57fa14056d Makes directory pkg compilable on Windows.
Also makes the test cases platform independent.

Signed-off-by: Rick Wieman <git@rickw.nl>
2015-03-12 15:54:22 +01:00
Ahmet Alp Balkan
718f112173 Make use of %USERPROFILE% in cli help message
An earlier commit was causing docker windows CLI build to not to pick up
the shorthand form for home directory (`%USERPROFILE%`) shown in when
`docker --help` is executed.

Fixing that bug and making the if statement concise and clear.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-03-11 02:14:49 -07:00
bobby abbott
2d49e3ce35 Remove import to utils in progressreader
Added method in StreamFormatter to handle calls
from progressreader. Solves #10959

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
2015-03-11 00:50:27 -07:00
Qiang Huang
d16f6bdb38 fix warning messages
Use log.Warnf instead of log.Infof, and remove redundant `WARNING` prefix.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-03-11 08:47:45 +08:00
Jessie Frazelle
c7bac5a484 Merge pull request #11288 from estesp/warn-on-localhost-dns
Add warning for --dns flag set to localhost addresses.
2015-03-10 12:03:46 -07:00
Phil Estes
716b0cd3b4 Add warning for --dns flag set to localhost addresses.
We should warn users who use the `--dns` command line option to point
DNS to a localhost address, either IPv4 or IPv6.  Unless they have
specifically set up the container as a DNS server or are using
--net=host (which is why this should be allowed, but warned on because
those are pretty unique cases) a localhost address as a resolver will
not reach what they might expect (e.g. expecting it will hit localhost
on the Docker daemon/host).

Added a test for the message, and fixed up tests to separate stdout and
stderr that were using `--dns=127.0.0.1` to test the options.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-03-10 14:43:17 -04:00
Dan Walsh
0586d52a00 If $HOME is not set, return homedir from /etc/passwd
Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-03-10 10:00:22 -04:00
Arnaud Porterie
29e7195aaf Remove subdirectories MAINTAINERS files
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-03-06 18:21:51 -08:00
Tibor Vass
0a46fb04bc Merge pull request #11148 from ahmetalpbalkan/win-cli/chmod-x-fix
pkg/archive: adjust chmod bits on windows
2015-03-06 12:28:58 -05:00
Ahmet Alp Balkan
be592674ac pkg/archive_windows: make use of os.PathSeparator
cc: @jhowardmsft

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-03-05 17:15:11 -08:00
Michael Crosby
c0b5b9cafe Merge pull request #11064 from delftswa2014/10970-treesize
Move directory size calculation to pkg/ (fixes #10970)
2015-03-05 13:06:02 -08:00
Ahmet Alp Balkan
276ed4fec4 pkg/archive: adjust chmod bits on windows
This change modifies the chmod bits of build context archives built on
windows to preserve the execute bit and remove the r/w bits from
grp/others.

Also adjusted integ-cli tests to verify permissions based on the platform
the tests are running.

Fixes #11047.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-03-04 14:10:37 -08:00
Martijn Dwars
973377a70d Move directory size calculation to pkg/ (fixes #10970)
Signed-off-by: Martijn Dwars <ikben@martijndwars.nl>
2015-03-04 21:16:31 +01:00
Tibor Vass
359ced0e44 Merge pull request #11147 from ahmetalpbalkan/archive_test_fix
pkg/archive: rm invalid test case from achive_windows_test.go
2015-03-04 09:51:36 -05:00
Jessie Frazelle
a0fb44fd1a Merge pull request #9437 from cpuguy83/set_rlimits_in_container
Allow setting ulimits for containers
2015-03-04 04:00:17 -08:00
Ahmet Alp Balkan
d33c7828b7 pkg/archive: rm invalid test case from achive_windows_test.go
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-03-03 18:42:52 -08:00
Jessie Frazelle
2a627ca2f7 Merge pull request #11002 from ahmetalpbalkan/win-cli/dockerfile-path-fix
Support windows style dockerfile paths for build cmd
2015-02-27 11:57:19 -08:00
Phil Estes
f2d40e9713 Merge pull request #11017 from brahmaroutu/random_10962
moving random.go from utils
2015-02-26 21:35:42 -05:00
Srini Brahmaroutu
38752a5727 moving random.go from utils
Closes #10962
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-02-26 18:31:18 +00:00
Brian Goff
cabcc398f6 Allow setting ulimits for containers
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-02-25 19:37:43 -05:00
Rik Nijessen
ee25c29598 Rename package timeout to timeoutconn.
Signed-off-by: Rik Nijessen <riknijessen@gmail.com>
2015-02-25 20:52:37 +01:00
Rik Nijessen
140d563d98 Move TimeoutConn to seperate pkg dir.
Fixes #10965
Signed-off-by: Rik Nijessen <riknijessen@gmail.com>
2015-02-25 17:09:47 +01:00
Ahmet Alp Balkan
140f461f50 Support windows style dockerfile paths for build cmd
Currently TestBuildRenamedDockerfile fails since passing
custom dockerfile paths like:

    docker build -f dir/file .

fails on windows because those are unix paths. Instead, on
windows accept windows style paths like:

    docker build -f dir\file .

and convert them to unix style paths using the helper we
have in `pkg/archive` so that daemon can correctly locate
the path in the context.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-02-24 20:23:53 -08:00
Srini Brahmaroutu
c9b4e665f9 Removing dependencies from pkg into Docker internal code
Closes #10922

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-02-23 18:43:10 +00:00
Alexander Morozov
3d26fc868b Merge pull request #10439 from estesp/10426-fix-arg-list-too-long
Pass excludes/options to tar unarchiver via environment versus cmd line
2015-02-20 23:48:55 -08:00
Michael Crosby
c44eed6358 Merge pull request #10865 from ahmetalpbalkan/win-cli/tar-path
pkg/archive: Canonicalize stored paths
2015-02-20 17:20:51 -08:00
Doug Davis
9ac0da4578 Fix for help when $HOME is /
estesp noticed that when $HOME is / the ~ substitutions messes up
becuase it tries to replace all paths that start with "/" with "~".
This fixes it so that it will only replace it when $HOME isn't "/".

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-02-19 22:21:17 -08:00
Phil Estes
2c7172b274 Pass excludes/options to tar unarchiver via environment
Fixes #10426

Because of the ability to easily overload the shell max argument list
length once the image count is several hundred, `docker load` will
start to fail because of this as it passes an excludes list of all
images in the graph.  This patch uses an environment variable with the
json marshalled through it to get around the arg length limitation.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-02-19 17:53:39 -08:00
Alexander Morozov
de0ed79618 Merge pull request #10819 from jsdir/10815-relative-path-fix
Fixed relative filepath check
2015-02-19 12:54:44 -08:00
Ahmet Alp Balkan
78a51d2d2c Shorten printed Windows paths on docker help cmd
This makes use of `%USERPROFILE%` as a substitute for
`~` on Windows and prints shorter strings for default
cert paths etc.

Also removes string escaping/quotes around default
path values printed in `docker help` command as they
are not really necessary and adds double backslashes
(\\) on windows.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-02-18 23:04:56 -08:00
Ahmet Alp Balkan
3907f3c2b6 pkg/homedir: implement GetShortcutString()
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-02-18 22:56:03 -08:00
Ahmet Alp Balkan
588f95dca0 pkg/archive: Canonicalize stored paths
Currently pkg/archive stores nested windows files with
backslashes (e.g. `dir\`, `dir\file.txt`) and this causes
tar not being correctly extracted on Linux daemon.

This change assures we canonicalize all paths to unix
paths and add them to tar with that name independent of platform.

Fixes the following test cases for Windows CI:
- TestBuildAddFileWithWhitespace
- TestBuildCopyFileWithWhitespace
- TestBuildAddDirContentToRoot
- TestBuildAddDirContentToExistingDir
- TestBuildCopyDirContentToRoot
- TestBuildCopyDirContentToExistDir
- TestBuildDockerignore
- TestBuildEnvUsage
- TestBuildEnvUsage2

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-02-17 16:51:04 -08:00
Jason Sommer
eba8586d2b Fixed relative filepath check
Signed-off-by: Jason Sommer <jsdirv@gmail.com>
2015-02-16 20:38:52 -06:00
Tianon Gravi
ed92fa5a28 Rename BINDDIR to BIND_DIR
It turns out the back-to-back `D`s here were tripping people up because visually, it looks like a typo.  This renames the variable to `BIND_DIR`, but allows `BINDDIR` to continue working for backwards-compatibility.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-02-13 15:50:42 -07:00
Michael Crosby
35464d7db3 Merge pull request #10424 from LK4D4/fix_non_tailed_log_format
Fix logs, so now, old and followed logs has same format without []
2015-02-06 14:35:45 -08:00
Michael Crosby
7637041156 Merge pull request #9705 from acbodine/9311-truncindex-error-duplicate-id-on-ambiguous-id
Closes #9311 Handles container id/name collisions against daemon functionalities according to #8069
2015-02-06 14:01:28 -08:00
Tibor Vass
6a360227e4 Merge pull request #10612 from vbatts/vbatts-archive_sort
pkg/archive: sort files
2015-02-06 16:50:53 -05:00
Ahmet Alp Balkan
2c44d13150 Export $HOME lookup to pkg/homedir
Signed-off-by: Ahmet Alp Balkan <ahmetb@microsoft.com>
2015-02-06 11:42:45 -08:00
Vincent Batts
ecf82746a8 pkg/archive: test that confirms hardlink ordering
This test was written against
master(abdfb21e3a761efdd70614de42905ff7911c5372) as a failing test, but
works with this patch set.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-02-06 18:14:38 +01:00