Commit graph

405 commits

Author SHA1 Message Date
Jessie Frazelle
a2ab067b3c Merge pull request #13022 from Microsoft/10662-addrsrc
Windows: Add resources for manifest and icon
2015-06-08 15:16:10 -07:00
Tibor Vass
bfed4b7cc3 Refactor TLS code with a new tlsconfig package
This patch creates a new `tlsconfig` package to handle creation of
secure-enough TLS configurations for clients and servers.

The package was created by refactoring TLS code in the client and the
daemon. After this patch, it is expected that all code creating TLS
configurations use this `tlsconfig` package for greater security,
consistency and readability.

On the server side, this fixes a bug where --tlsverify was not taken
into account. Now, if specified, it will require the client to
authenticate.

Signed-off-by: Tibor Vass <tibor@docker.com>
2015-06-05 12:38:38 -04:00
John Howard
fd935ee63d Windows: Build docker.exe manifested and with icon
Signed-off-by: John Howard <John.Howard@microsoft.com>
2015-06-04 11:49:10 -07:00
Jessica Frazelle
b372f9f224 fix experimental version and release script
add api version experimental

Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-05-29 10:00:22 -07:00
Arnaud Porterie
78578125ce Add suffix to experimental builds version
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-05-21 16:27:42 -07:00
Arnaud Porterie
ca6722f1c5 Add DOCKER_EXPERIMENTAL environment variable
The DOCKER_EXPERIMENTAL environment variable drives the activation of
the 'experimental' build tag.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-05-20 12:21:17 -07:00
Doug Davis
a85ca8b7c4 add link between -D and --log-level=debug back in
Due to popular demand :-)
See #11965

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-14 10:29:49 -07:00
Antonio Murdaca
56847ec4d4 Merge pull request #13106 from duglin/HumanizeCliErrors
Use stderr instead of logrus for CLI error messages
2015-05-13 05:23:56 +02:00
Jessie Frazelle
36d995a291 Merge pull request #11965 from duglin/DEBUG
Remove use of "DEBUG" env var from CLI and de-couple -D from --log-level
2015-05-12 18:24:04 -07:00
Doug Davis
0024935f64 Use stderr instead of logrus for CLI error messages
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-12 17:22:41 -07:00
Jessie Frazelle
fe3becee34 Merge pull request #12422 from wlan0/logopts
add log opts flag to pass in logging options
2015-05-07 18:10:04 -07:00
Jessie Frazelle
47fbe76a7e Merge pull request #13077 from duglin/MoveCommands
Make list of commands for help less static
2015-05-07 17:35:54 -07:00
Doug Davis
4f00b1020e Make list of commands for help less static
Before this PR the list of commands that were printed for the help
text was statically put into the flags.Usage() function via main.init(). This
made it impossible to modify later on when we add new commands
via plugins.

This PR moves the list of commands (name & description) into a structure
that is sorted and printed dynamically by the Usage func.  This will allow
the code to add to the list of commands after the init() func is done
but before the help text is printed for the user.

This just moves code around - it should have no UX impact at all.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-07 16:22:06 -07:00
Alexander Morozov
08230703fd Fix api servers creation and daemon start order
* daemon creation wasn't parallel to request buffering
* it was possible that empty volume will be created in
  /var/run/docker.sock by some container

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-05-07 15:38:02 -07:00
wlan0
dca9e02b15 Add log opts flag to pass in logging options
Signed-off-by: wlan0 <sidharthamn@gmail.com>
2015-05-04 14:39:48 -07:00
jhowardmsft
cbf9a64cb5 Windows: Change default listener to HTTP
Signed-off-by: jhowardmsft <jhoward@microsoft.com>
2015-04-30 19:49:45 -07:00
Antonio Murdaca
531f4122bd Remove engine mechanism
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-30 01:35:16 +02:00
Doug Davis
534ed8c2d4 Remove use of "DEBUG" env var from CLI and decouple DEBUG from --log-level
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-29 06:20:33 -07:00
Antonio Murdaca
4b9fe9c298 Remove job from container_inspect
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-23 00:58:13 +02:00
David Calavera
ae4063585e Remove engine.Job from builder.CmdBuildConfig.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-20 13:37:06 -07:00
Alexander Morozov
d9ed316522 Make API server datastructure
Added daemon field to it, will use it later for acces to daemon from
handlers

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-20 08:13:39 -07:00
Alexander Morozov
181fea24aa Make daemon initialization in main goroutine
It is simplifies code and lead to next refactoring step, where daemon
will be incorporated to some structure which represents API.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-20 08:13:39 -07:00
Antonio Murdaca
a0bf80fe03 Remove builtins
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-17 14:27:38 +02:00
Deshi Xiao
bae3023eef client.StatusError don't be returned as a pointer
closes #12373

1. remove & from client.StatusError
2. remove * from Error method

Signed-off-by: Deshi Xiao <xiaods@gmail.com>
2015-04-16 01:27:07 +08:00
Antonio Murdaca
c30a55f14d Refactor utils/utils, fixes #11923
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-14 01:37:36 +02:00
Jessie Frazelle
ebd7df3bbe Merge pull request #11909 from runcom/11908-refactor-utils-utils-daemon
Refactor utils/utils_daemon
2015-04-07 13:24:24 -07:00
Arnaud Porterie
ac93a13e27 Merge pull request #11554 from Sirupsen/logrus-fields
logging: use logrus fields
2015-04-06 09:00:18 -07:00
Simon Eskildsen
e1ca439828 daemon: convert version log statement to fields
Signed-off-by: Simon Eskildsen <sirup@sirupsen.com>
2015-04-03 18:22:17 -04:00
Antonio Murdaca
01724c1cf1 Refactor ultis/utils_daemon, fixes #11908
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-03 20:20:04 +02:00
Michael Crosby
03d3d79b2b Remove jobs from registry.Service
This makes `registry.Service` a first class type and does not use jobs
to interact with this type.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-03-31 16:38:04 -07:00
Michael Crosby
62806cc85e Refactor API socket handling
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-03-31 13:37:49 -07:00
Tiffany Low
711e580320 Upgrade logrus to v0.7.2
- Daemon logs now report to millisecond resolution

Signed-off-by: Tiffany Low <the.second.angel@gmail.com>
2015-03-30 12:27:03 -07:00
Antonio Murdaca
6f4d847046 Replace aliased imports of logrus, fixes #11762
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-26 23:22:04 +01:00
Arnaud Porterie
e09ead98ef Merge pull request #11566 from tiborvass/carry-10864
Carry 10864: ANSI terminal emulation for windows
2015-03-22 18:21:32 -07:00
Tibor Vass
01a43174da winconsole: cleanup
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-03-22 15:47:54 -04:00
Brian Goff
16309bef63 Add integration test for unix sock cleanup
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-03-20 12:34:35 -04:00
Sachin Joshi
816d602059 Reduce memory allocation and remove channels
Signed-off-by: Sachin Joshi <sachin_jayant_joshi@hotmail.com>
2015-03-19 18:07:56 -07:00
Phil Estes
459e58ffc9 Fix daemon shutdown on error after rework of daemon startup
Currently the daemon will not stop on error because the serve API job is
blocking the channel wait for daemon init.  A better way is to run the
blocking serve API job as a goroutine and make sure that error
notification gets back to the main daemon thread (using the already
existing channel) so that clean shutdown can occur on error.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-03-17 14:15:00 -04:00
Sachin Joshi
898d2763c5 Move windows console specific implementation in sub package
Signed-off-by: Sachin Joshi <sachin_jayant_joshi@hotmail.com>
2015-03-16 14:04:53 -07:00
Sachin Joshi
d8c3090dd9 ANSI terminal emulation for windows
It is implemented by intercepting and interpreting the output
escape sequence by calling win32 console apis.

In addition the input from win32 console is translated to linux keycodes

Signed-off-by: Sachin Joshi <sachin_jayant_joshi@hotmail.com>
2015-03-16 14:04:49 -07:00
Jessica Frazelle
17a784aa09 cleanup defer func
Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <hugs@docker.com> (github: jfrazelle)
2015-03-10 12:18:43 -07:00
Brian Goff
0e3f2f2ac0 Ensure clean engine shutdown on startup errors
Previously on error either from the daemon or from the api it is just
exiting with exit status 1 but not performing a shutdown.
This can produce insconsistent state depending on where the error came
from.

This makes sure that before we exit on error that the engine gets fully
shutdown.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-03-09 08:40:38 -04:00
resouer
f3dd2db4ff Add cors header flag and leave boolean flag not changed
Deprecate api-enable-cors

Update docs & man files

Signed-off-by: harry zhang <resouer@163.com>
2015-03-03 11:21:19 +08:00
Shishir Mahajan
0ab28c6589 Fix: docker -d -h start daemon instead of showing help menu
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
2015-03-02 17:01:56 -05:00
Zen Lin(Zhinan Lin)
08ea03ccb9 To avoid the confusing in log, change '%s' to '%q', change the question sentence to a reminding sentence.
Signed-off-by: Zen Lin(Zhinan Lin) <linzhinan@huawei.com>
2015-03-02 19:14:22 +08:00
Srini Brahmaroutu
6871b9b16a Removing -X flag option and autogenerated code to create Dockerversion.go functionality
Addresses #9207

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-02-20 05:40:12 +00:00
Ahmet Alp Balkan
27a73a98b7 Shorten help messages for docker cmd flags
In order to fit printed messages to fit 80 chars,
rewording messages for `-H` and `--tls` flags.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-02-18 22:52:33 -08:00
Aidan Hobson Sayers
06ea5fe979 Move daemon-only flags into the daemon config struct
Signed-off-by: Aidan Hobson Sayers <aidanhs@cantab.net>
2015-02-08 12:56:18 +00:00
Ahmet Alp Balkan
f9ae2d4fd4 Export $HOME lookup to pkg/homedir
Signed-off-by: Ahmet Alp Balkan <ahmetb@microsoft.com>
2015-02-06 11:42:45 -08:00
Ahmet Alp Balkan
6ffb77afd4 Extract $HOME usages into utils.GetHomeDir()
Refactored getHomeDir in docker/docker to GetHomeDir in utils
pkg. Currently covers all use cases on the client-side.

Signed-off-by: Ahmet Alp Balkan <ahmetb@microsoft.com>
2015-02-05 16:13:51 -08:00
Doug Davis
2203b37733 Pretty the help text
This modifies the "docker help" text so that it is no wider than 80 chars
and each description fits on one line. This will also try to use ~ when
possible

Added a test to make sure we don't go over 80 chars again.
Added a test to make sure we use ~

Applied rules/tests to all docker commands - not just main help text

Closes #10214

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-02-04 07:59:16 -08:00
Derek McGowan
0eed1f4d8d Defer creation of trust key file until needed
Fixes #10442

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-01-29 13:46:12 -08:00
DiuDiugirl
471006c02f Fix a minor typo
Docker inspect can also be used on images, this patch fixed the
minor typo in file docker/flags.go and docs/man/docker.1.md

Signed-off-by:  DiuDiugirl <sophia.wang@pku.edu.cn>
2015-01-24 15:08:33 +08:00
Derek McGowan
d55e977cf5 Fix nits and defers
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-01-22 11:22:31 -08:00
Derek McGowan
a34a7930b5 Add TODO lines for windows
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-01-22 10:29:15 -08:00
Derek McGowan
007ef161b4 Add key migration to daemon
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-01-21 16:55:05 -08:00
Derek McGowan
06af013f8b Fix daemon key file location
Fixes #10233

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-01-21 16:28:19 -08:00
Michael Crosby
db9b1e3654 Update to docker stats documentation
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-01-21 11:44:23 -08:00
Michael Crosby
76141a0077 Add documentation for stats feature
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-01-20 20:21:47 -08:00
Michael Crosby
4f174aa792 Evict stopped containers
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-01-20 20:21:46 -08:00
Michael Crosby
1efc940e6f Merge pull request #10124 from duglin/Issue10034
Add the list of possible values for --log-level to help text
2015-01-19 17:09:18 -08:00
Derek McGowan
25945a40c4 Refactor from feedback
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-01-15 14:05:06 -08:00
Derek McGowan
ac8d964b28 Add trust key creation on client
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-01-15 14:04:14 -08:00
Doug Davis
ed13110e88 Add the list of possible values for --log-level to help text
Closes #10034

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-01-15 12:20:41 -08:00
Srini Brahmaroutu
21a809d9ae rename a existing container
Closes #3036

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-01-13 03:27:17 +00:00
Don Kjer
568f86eb18 Deprecating ResolveRepositoryName
Passing RepositoryInfo to ResolveAuthConfig, pullRepository, and pushRepository

Moving --registry-mirror configuration to registry config

Created resolve_repository job

Repo names with 'index.docker.io' or 'docker.io' are now synonymous with omitting an index name.

Adding test for RepositoryInfo

Adding tests for opts.StringSetOpts and registry.ValidateMirror

Fixing search term use of repoInfo

Adding integration tests for registry mirror configuration

Normalizing LookupImage image name to match LocalName parsing rules

Normalizing repository LocalName to avoid multiple references to an official image

Removing errorOut use in tests

Removing TODO comment

gofmt changes

golint comments cleanup.  renaming RegistryOptions => registry.Options, and RegistryServiceConfig => registry.ServiceConfig

Splitting out builtins.Registry and registry.NewService calls

Stray whitespace cleanup

Moving integration tests for Mirrors and InsecureRegistries into TestNewIndexInfo unit test

Factoring out ValidateRepositoryName from NewRepositoryInfo

Removing unused IndexServerURL

Allowing json marshaling of ServiceConfig.  Exposing ServiceConfig in /info

Switching to CamelCase for json marshaling

PR cleanup; removing 'Is' prefix from boolean members.  Removing unneeded json tags.

Removing non-cleanup related fix for 'localhost:[port]' in splitReposName

Merge fixes for gh9735

Fixing integration test

Reapplying #9754

Adding comment on config.IndexConfigs use from isSecureIndex

Remove unused error return value from isSecureIndex

Signed-off-by: Don Kjer <don.kjer@gmail.com>

Adding back comment in isSecureIndex

Signed-off-by: Don Kjer <don.kjer@gmail.com>
2015-01-08 20:14:58 +00:00
Dan Walsh
a2b529ead2 --help option and help command should print to stdout not stderr
--help and help are successful commands so output should not go to error.

    QE teams have requested this change, also users doing docker help | less
    or docker run --help | less would expect this to work.

    Usage statement should only be printed when the user asks for it.
    Errors should print error message and then suggest the docker COMMAND --help
    command to see usage information.

    The current behaviour causes the user to have to search for the error message
    and sometimes scrolls right off the screen.  For example a error on a
    "docker run" command is very difficult to diagnose.

    Finally erros should always exit with a non 0 exit code, if the user
    makes a CLI error.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-01-06 13:40:14 +01:00
Doug Davis
ae9bd580af Make --tlsverify enable tls regardless of value specified
I also needed to add a mflag.IsSet() function that allows you to check
to see if a certain flag was actually specified on the cmd line.

Per #9221 - also tweaked the docs to fix a typo.

Closes #9221

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-11-20 16:09:06 -08:00
Michael Crosby
c1a40d9279 Merge pull request #9228 from SvenDowideit/update-tlsverify-doc
tlsverify flag has no dash
2014-11-20 15:19:31 -08:00
Sven Dowideit
a0fb8eca30 tlsverify flag has no dash
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2014-11-18 17:42:33 -08:00
Victor Vieux
9a85f60c75 add ID and Hostname in docker info
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-11-17 19:23:41 +00:00
Alexandr Morozov
61e4b4e1d0 Merge pull request #8335 from duglin/Issue5198
Add --log-level support - Issue #5198
2014-11-15 10:53:31 -08:00
Doug Davis
2facc04673 Add --log-level support
Next steps, in another PR, would be:
- make all logging go through the logrus stuff
- I'd like to see if we can remove the env var stuff (like DEBUG) but we'll see

Closes #5198

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-11-15 09:00:48 -08:00
Ahmet Alp Balkan
d4dbb70832 Use USERPROFILE path on Windows as home directory
Signed-off-by: Ahmet Alp Balkan <ahmetb@microsoft.com>
2014-11-14 18:20:54 -08:00
Alexandr Morozov
18d9f1978b Fix vet errors
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-11-05 08:26:22 -08:00
Lei Jitang
d8b17d785a Fix docker exec command help messages
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2014-10-31 09:36:07 +08:00
Jessie Frazelle
793fb26bff Merge pull request #8510 from hqhq/graphdriver_bug
daemon: resolve the graphdriver to show
2014-10-30 17:40:30 -07:00
Michael Crosby
afade4236d Don't hard code true for auth job
Signed-off-by: Michael Crosby <michael@docker.com>

Conflicts:
	registry/service.go
2014-10-30 19:41:55 -04:00
unclejack
acd64278f1 pkg/reexec: move reexec code to a new package
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-10-30 14:48:30 +02:00
Alexandr Morozov
7c62cee51e Use logrus everywhere for logging
Fixed #8761

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-10-24 15:03:06 -07:00
Jessica Frazelle
a7aedca4a1 Client should use go log package.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-10-24 13:03:46 -07:00
Qiang Huang
7cf322dffc daemon: resolve the graphdriver to show
graphdriver is not always specified when the log printed, because
it's provided in another thread. This patch will fix this.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2014-10-21 15:00:25 +08:00
Tibor Vass
10f78974ca Merge pull request #8588 from dqminh/remove-sslv3
remove sslv3 from server's TLS supported versions
2014-10-17 12:05:48 -04:00
Alexandr Morozov
cb106e74a1 Merge pull request #8238 from vbatts/vbatts-daemon_timestamps
daemon logging: unifying output and timestamps
2014-10-16 15:55:49 -07:00
Daniel, Dao Quang Minh
7a062b2b8f Avoid fallback to SSL protocols < TLS1.0
Signed-off-by: Tibor Vass <teabee89@gmail.com>

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
2014-10-15 22:39:51 -04:00
Michael Crosby
712e8da885 Remove client key.json generation for trust
This removes the key generation for trust from main while it is not
being consumed.  The problem is that because this is being set in main
if a user runs as root initially the files will be owned by root.  Later
if the user sets up the docker group they are unable to read the keys.
This is half a user error and documentation problem and the other half
is management.

We decided to remove this code for now while it is not being used and
will revisit it later when the consuming features are added.  A few
options are to generate lazily and provide a clear error message on an
EPERM so that the user knows what is wrong and can correct the
permissions.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-10-14 17:16:45 +00:00
Aanand Prasad
19fb942d36 Add DOCKER_TLS_VERIFY environment variable, equivalent to --tlsverify flag
This makes it possible to make the Docker client "secure by default"
without wrapping the binary in a shell alias so that `--tlsverify` is
always passed.

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2014-10-13 11:49:26 +01:00
Derek McGowan
ea6a480128 Add libtrust key identity management
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2014-09-26 15:52:08 -07:00
Vincent Batts
92df943fbf daemon logging: unifying output and timestamps
A little refactor of the ./pkg/log so engine can have a logger instance

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2014-09-26 14:44:46 -04:00
Alexandr Morozov
ca39a3e36b Merge pull request #7110 from tiborvass/merge-6907
Docker create (rebase of 6907)
2014-09-17 03:23:50 +04:00
Alexander Larsson
3a90004f3c Add "docker create" support
This exposes the already existing "create container" operation.  It is
very similar to "docker run -d" except it doesn't actually start the
container, but just prepares it. It can then be manually started using
"docker start" at any point.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)

Conflicts:
	api/client/commands.go
	runconfig/parse.go
	server/container.go

Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
2014-09-16 18:40:24 -04:00
unclejack
fccb026221 add exec to the commands list
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-09-17 01:13:43 +03:00
Ben Firshman
fec81690cc Consolidate documentation for -H option
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2014-09-09 10:12:03 -07:00
Ben Firshman
d128d9e669 Add instructions on how to get help on commands
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2014-09-08 16:09:16 -07:00
Ben Firshman
f3ed7b601f Print consistent help with options and commands
These commands now all output the same thing:

 - docker
 - docker help
 - docker --help
 - docker -h

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2014-09-08 16:08:50 -07:00
Erik Hollensbe
1ae4c00a19 builder: fix references to jobs in daemon, make builder a first class
package referring to evaluator

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-27 18:52:30 -07:00
Victor Vieux
2e489073d9 Revert "--help option and help command should print to stdout not stderr"
This reverts commit 61b129d818.

Signed-off-by: Victor Vieux <vieux@docker.com>
2014-08-27 18:59:13 +00:00
Victor Vieux
76fd51a478 Merge pull request #6052 from rhatdan/help
--help option and help command should print to stdout not stderr
2014-08-27 11:17:16 -07:00
Alexandr Morozov
660cc4a267
Fix panic for DOCKER_HOST without ://
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-08-26 20:32:10 +04:00
Dan Walsh
61b129d818 --help option and help command should print to stdout not stderr
--help and help are successful commands so output should not go to error.

QE teams have requested this change, also users doing docker help | less
or docker run --help | less would expect this to work.

Usage statement should only be printed when the user asks for it.
Errors should print error message and then suggest the docker COMMAND --help
command to see usage information.

The current behaviour causes the user to have to search for the error message
and sometimes scrolls right off the screen.  For example a error on a
"docker run" command is very difficult to diagnose.

Finally erros should always exit with a non 0 exit code, if the user
makes a CLI error.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2014-08-21 15:35:20 -04:00
Solomon Hykes
1d10c55aec Move remote API config out of daemon/
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-13 19:25:51 +00:00
Solomon Hykes
1eba59eb24 Check for conflicting daemon config options in NewDaemon
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-13 19:25:51 +00:00
Solomon Hykes
ca11b77471 opts.IPVal returns an error on incorrect input
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-13 19:25:51 +00:00
Solomon Hykes
353b7c8ec7 Parse daemon configuration in daemon.Config.InstallFlags instead of main
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-13 19:25:51 +00:00
Solomon Hykes
6200002669 Helpers to parse lists, IPs, hosts, dns searches from the command line
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-13 19:25:47 +00:00
Solomon Hykes
a4befff533 Move daemonconfig into daemon
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-13 19:09:51 +00:00
Solomon Hykes
63503cafe4 Remove deprecated server/ package
Victory!

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-13 06:56:45 +00:00
Victor Vieux
01995ebebb Merge pull request #7490 from crosbymichael/reexec
Use argv0 as reexec implementation for dockerinit
2014-08-11 18:43:34 -07:00
Michael Crosby
7321067176 Use argv0 as reexec implementation for dockerinit
This changes the way the exec drivers work by not specifing a -driver
flag on reexec.  For each of the exec  drivers they register their own
functions that will be matched aginst the argv 0 on exec and called if
they match.

This also allows any functionality to be added to docker so that the
binary can be reexec'd and any type of function can be called.  I moved
the flag parsing on docker exec to the specific initializers so that the
implementations do not bleed into one another.  This also allows for
more flexability within reexec initializers to specify their own flags
and options.

Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-11 11:47:21 -07:00
Solomon Hykes
a110ce2f28 Rename a method for clarity
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-10 04:33:19 +00:00
Solomon Hykes
b4efcd53e0 Remove unnecessary job "initserverpidfile"
That job was a hacky solution to a real race condition. This removes the
hack without re-introducing the race.

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:56:11 +00:00
Solomon Hykes
c9f3fd3fc7 Cleanup: refactor shutdown and signal handling facility
This disentangles the following functions, which were previously all mixed together:

* 1) Waiting for jobs to terminate when shutting down
* 2) Handling signals in the Docker daemon
* 3) Per-subsystem cleanup handlers
* 4) pidfile management

Responsibilities are dispatched as follows:

* Signal traps are set in `main`, and trigger `engine.Shutdown`
* `engine.Shutdown` coordinates cleanup by waiting for jobs to complete, and calling shutdown handlers
* To perform cleanup at shutdown, each subsystem registers handlers with `engine.OnShutdown`
* `daemon` is one subsystem, so it registers cleanup via `engine.OnShutdown`.
* `daemon` owns the pidfile, which is used to lock access to `/var/lib/docker`. Part of its cleanup is to remove the pidfile.

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:56:11 +00:00
Ben Firshman
a49de2c467 Rename DOCKER_CONFIG envvar to DOCKER_CERT_PATH
DOCKER_CONFIG was introduced in #6984.

We may use "config" for other purposes (e.g. #7232). Until we
have made a design decision around how configuration files will
work, DOCKER_CERT_PATH is a much safer name to rely on for future
compatibility.

Docker-DCO-1.1-Signed-off-by: Ben Firshman <ben@firshman.co.uk> (github: bfirsh)
2014-08-04 17:36:53 -07:00
Tianon Gravi
1b95590d06 Add a "daemon" build tag and toggle it with the already-existing "DOCKER_CLIENTONLY" build variable
This works mostly by refactoring our "main" package to be careful about what it imports based on the daemon build tag. :)

Also, I've updated Travis to test "client-only" compilation after it tests the daemon version.

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-08-04 15:05:12 -06:00
Solomon Hykes
4949e070fb Move kernel version/capabilities detection to NewDaemon
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-07-30 09:26:51 +00:00
Solomon Hykes
e92a9e0b53 Move canonical root path detection to NewDaemon
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-07-30 09:26:51 +00:00
Solomon Hykes
a7d8c732b1 Move TMPDIR symlink cleanup to NewDaemon
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-07-30 09:26:51 +00:00
Solomon Hykes
419b9fe164 Check for OS and root privileges in NewDaemon
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-07-30 09:26:51 +00:00
Erik Hollensbe
4398108433 Move parsing functions to pkg/parsers and the specific kernel handling
functions to pkg/parsers/kernel, and parsing filters to
pkg/parsers/filter. Adjust imports and package references.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-07-29 13:09:10 -07:00
Victor Vieux
b3ee9ac74e update go import path and libcontainer
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-07-24 22:19:50 +00:00
Victor Vieux
d0e2d9ec39 Merge pull request #6976 from vbatts/vbatts-early_daemon_pidfile
docker daemon: initialize the daemon pidfile early
2014-07-21 14:26:14 -07:00
James Kyle
c0471ee35a Closes 6937. Allows setting of docker config dir.
Can now dynamically set the docker config directory through an
environment variable.

export DOCKER_CONFIG=/path/to/docker_config/

Default behavior remains the same, e.g. ~/.docker

Documentation for change added to the https.md docs.

Docker-DCO-1.1-Signed-off-by: James A. Kyle <james@jameskyle.org> (github: jameskyle)
2014-07-15 15:47:00 -07:00
Vincent Batts
848e837698 docker daemon: initialize the daemon pidfile early
fixes https://github.com/dotcloud/docker/issues/6973

Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
2014-07-12 08:25:05 -04:00
Victor Vieux
b68111713d update for consistency
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-07-09 21:48:02 +00:00
Jan Pazdziora
899e9e7416 Add support for IPv6 addresses in --dns parameters.
Docker-DCO-1.1-Signed-off-by: Jan Pazdziora <jpazdziora@redhat.com> (github: adelton)
2014-07-09 21:48:02 +00:00
Victor Vieux
170609e369 Merge pull request #6720 from fabiofalci/relax_dns_search
Relax dns search to accept empty domain
2014-07-07 15:12:29 -07:00
Fabio Falci
804b00cd7d Relax dns search to accept empty domain
In that case /etc/resolv.conf will be generated with no search
option. Usage: --dns-search=.

Docker-DCO-1.1-Signed-off-by: Fabio Falci <fabiofalci@gmail.com> (github: fabiofalci)
2014-07-04 09:33:53 +01:00
Matthew Heon
4318802f64 Error if Docker daemon starts with BTRFS graph driver and SELinux enabled
The Docker btrfs graph driver does not interact well with SELinux at present.
If btrfs mounts the same file in several locations, the same SELinux label will
be applied to all mountpoints. In the context of the graph driver, things such
as shared libraries become inaccessible to containers due to SELInux, causing
all dynamically linked applications to fail when run in a container.

Consequently, error when we detect the daemon is being run with SELinux enabled
and the btrfs driver. Documentation has been added for this behavior.

Docker-DCO-1.1-Signed-off-by: Matthew Heon <mheon@redhat.com> (github: mheon)
2014-07-03 08:11:18 -04:00
Jiří Župka
2fcbfb5a66 Adds check if default ip address is correct format.
It avoids hidden error when ports are redirected from
container to host using -p host_port:guest_port.

Docker-DCO-1.1-Signed-off-by: Jiří Župka <jzupka@redhat.com> (github: jzupka)
2014-06-27 15:55:20 +02:00
Erik Hollensbe
05f293e65e Add mutex warning when specifying -icc or -ip-forward and -iptables=false
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-06-24 15:49:35 -07:00
Sven Dowideit
f54823bf05 Add Sockets (-H) list to docker -D info.
This will allow us to _know_ what the user's -H settings are, which may
be useful for debugging later.

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)
2014-06-24 12:25:17 +10:00
Jonathan Boulle
6d14e9f1ac be consistent in capitalization of Docker
Docker-DCO-1.1-Signed-off-by: Jonathan Boulle <jonathanboulle@gmail.com> (github: jonboulle)
2014-06-20 14:05:46 -07:00
Victor Vieux
7c52ab7f83 Merge pull request #5878 from timthelion/docs-docker-readme
Add README.md file for the docker directory
2014-06-18 12:19:43 -07:00
Alexander Larsson
822ea97ffc Add --storage-opt graph driver option and pass through to driver
This lets you add storage specific options for the daemon.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-06-05 10:42:27 +02:00
Timothy
6854e2997e Add README.md file for the docker directory
See issue #5873

Docker-DCO-1.1-Signed-off-by: Timothy <timothyhobbs@seznam.cz> (github: https://github.com/timthelion)
2014-05-20 09:04:46 +00:00
Victor Vieux
704e9f9ff0 Merge pull request #5761 from SvenDowideit/pr_out_tell_the_user_not_to_run_from_osx
tell the user not to run -d from OSX
2014-05-16 16:52:08 -07:00
SvenDowideit
fe445a2447 tell the user not to run from OSX
Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-05-13 12:51:00 +10:00
Victor Vieux
937f8f2d81 move acceptconnections as builtin
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-05-13 01:53:38 +00:00
Victor Vieux
f3736265fd make listen buffer optional
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-05-13 01:51:41 +00:00
Victor Vieux
b622da3cfe improve some usages
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-05-06 21:32:12 +00:00
Victor Vieux
51933bd5e1 Merge pull request #5575 from vieux/pr-5428 2014-05-05 13:48:36 -07:00
Guillaume J. Charmes
5f301191cf Merge pull request #5496 from unclejack/check_if_root
check if the daemon is run as root on startup
2014-05-05 10:13:17 -07:00
Victor Vieux
328d65dcff remove fixme
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-05-03 00:54:52 +00:00
unclejack
4fac4d2149 check if the daemon is run as root on startup
This commit makes Docker throw an error if the daemon isn't started as
root.

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-04-30 14:13:39 +03:00
Dan Walsh
b7942ec2ca This patch reworks the SELinux patch to be only run on demand by the daemon
Added --selinux-enable switch to daemon to enable SELinux labeling.

The daemon will now generate a new unique random SELinux label when a
container starts, and remove it when the container is removed.   The MCS
labels will be stored in the daemon memory.  The labels of containers will
be stored in the container.json file.

When the daemon restarts on boot or if done by an admin, it will read all containers json files and reserve the MCS labels.

A potential problem would be conflicts if you setup thousands of containers,
current scheme would handle ~500,000 containers.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: crosbymichael)
2014-04-29 03:40:05 -07:00
Michael Crosby
f0e6e135a8 Initial work on selinux patch
This has every container using the docker daemon's pid for the processes
label so it does not work correctly.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-04-29 03:40:05 -07:00
Sven Dowideit
b2c87fe08b add a reference to multiple -H options, and update the other example of -H option
and copy changes to the cli.md file

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)
2014-04-24 11:24:58 +10:00
Mike MacCana
e62efb266f - unix://path/to/socket should read unix:///path/to/socket like the rest of the documentation (a slash was missing)
- Mention that [] options may be specified multiple times on the Usage page

Docker-DCO-1.1-Signed-off-by: Mike MacCana <mike.maccana@gmail.com> (github: mikemaccana)

Docker-DCO-1.1-Signed-off-by: Mike MacCana <mike.maccana@gmail.com> (github: SvenDowideit)
2014-04-24 11:11:51 +10:00
Michael Crosby
7100ace42b Remove error from engine.New()
Without creating a root there is no way for the engine to return an
error from the new function.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-04-23 11:54:35 -07:00
Michael Crosby
672edfe807 Remove the concept of a root dir out of engine
This makes the engine more general purpose so that we can
use it and the job routing functionality for reexec'ing our binary
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)

Conflicts:
	integration/runtime_test.go
2014-04-22 19:04:03 -07:00