Commit Graph

151 Commits

Author SHA1 Message Date
Tianon Gravi bd5c6de3b9 Run 'gofmt -s -w' 2014-01-06 22:14:35 -07:00
Solomon Hykes 4455d8a6d0 Move utility package 'namesgenerator' to pkg/namesgenerator 2013-12-23 23:45:18 +00:00
Victor Vieux 79ba2af333 Merge pull request #2930 from creack/docker-osx
Docker client on OSX
2013-12-03 15:27:21 -08:00
Guillaume J. Charmes b28334e5d8 Move reflink to os dependent file. OSX docker client fully functionnal. 2013-11-27 19:23:48 -08:00
Guillaume J. Charmes 345c93d6bf Refactor Opts 2013-11-26 17:46:06 +00:00
Michael Crosby 96ba356d5d Merge branch 'master' into 0.6.5-dm-plugin 2013-11-22 14:06:59 -08:00
Guillaume J. Charmes 8ee3bc1c54 Use a constant for PortSpecTemplate + display the template in the CmdRun help 2013-11-22 12:00:34 -08:00
Guillaume J. Charmes e33b345719 Reformatting parseRun and partParse 2013-11-22 11:58:02 -08:00
Guillaume J. Charmes b1cf8cf658 Merge branch 'master' into shykes-0.6.5-dm-plugin
Conflicts:
	utils.go
	utils_test.go
2013-11-14 14:02:44 -08:00
Michael Crosby b44364e327 Merge pull request #2445 from alexlarsson/fix-shared-root-from-dm
Fix lxc start for shared root filesystems
2013-11-14 11:20:53 -08:00
Solomon Hykes 712fabe7b1 Move Change to the archive package 2013-11-07 16:46:47 -08:00
Solomon Hykes 73776adf90 Move Change to the archive package, and fix a leftover merge in
Container.Inject()
2013-11-08 00:45:07 +00:00
Solomon Hykes f97d6c425d gofmt 2013-11-07 23:58:03 +00:00
Solomon Hykes 29242e9c0c Merge branch 'master' into 0.6.5-dm-plugin
Conflicts:
	container.go
	runtime.go
2013-11-07 23:26:52 +00:00
Victor Vieux 179aa17c74 fix mergeConfig with new ports 2013-11-07 14:31:25 -08:00
Alexander Larsson 410e7b9793 lxc: Work around lxc-start need for private mounts
lxc-start requires / to be mounted private, otherwise the changes
it does inside the container (both mounts and unmounts) will propagate
out to the host.

We work around this by starting up lxc-start in its own namespace where
we set / to rshared.

Unfortunately go can't really execute any code between clone and exec,
so we can't do this in a nice way. Instead we have a horrible hack that
use the unshare command, the shell and the mount command...
2013-11-06 20:43:06 +01:00
Solomon Hykes b792c2a08b Partial merge of devmapper/ in order to integrate it as a backend
plugin.

The merge is inert, in other words the devmapper code is not called
and the primary aufs backend is untouched.
2013-11-01 04:24:17 +00:00
Victor Vieux c402559c8e check port is valid 2013-10-31 19:00:14 -07:00
Michael Crosby 10a8d35f7c Assign id as name when all else fails 2013-10-30 18:31:18 -07:00
Michael Crosby 010bfdfd5e Hotfix: Migrate public mappings after upgrade 2013-10-30 08:15:12 -07:00
Michael Crosby 97dea5afdc Add -name for docker run
Remove docker link
Do not add container id as default name
Create an auto generated container name if not
specified at runtime.
2013-10-28 18:09:08 -07:00
Alexander Larsson 56a8f21ae9 Move ListOps to utils submodule
This will be needed for later use in docker-init without a docker
dependency
2013-10-25 15:13:24 -07:00
Michael Crosby 36d6b76cad Add links for container relationships and introspection 2013-10-25 15:13:24 -07:00
Guillaume J. Charmes 77a92070a4 Merge branch 'master' into dm
Conflicts:
	Dockerfile
	buildfile.go
	container.go
	hack/make/test
	runtime_test.go
	utils/utils.go
2013-10-18 12:38:29 -07:00
Victor Vieux 19a92ee57f add missing error check 2013-10-03 22:33:00 +00:00
Alexander Larsson af46f235e8 RootIsShared: Fix root detection
Column 4 is the mount position, column 3 will not always be
"/" for the root. On one of my system its "/root".
2013-09-26 15:09:33 +00:00
Alexander Larsson 2e4352d768 Add CopyFile that can use btrfs reflinks if availible 2013-09-26 15:09:32 +00:00
Alexander Larsson 7bab7cb365 RootIsShared() - Fix array out of bounds error
This happened for me on the last (empty) line, but better safe than sorry
so we make the check general.
2013-09-26 15:09:32 +00:00
Alexander Larsson a461533284 lxc: Work around lxc-start need for private mounts
lxc-start requires / to be mounted private, otherwise the changes
it does inside the container (both mounts and unmounts) will propagate
out to the host.

We work around this by starting up lxc-start in its own namespace where
we set / to rprivate.

Unfortunately go can't really execute any code between clone and exec,
so we can't do this in a nice way. Instead we have a horrible hack that
use the unshare command, the shell and the mount command...
2013-09-26 15:09:32 +00:00
Victor Vieux 6e8e12e56f abord build if mergeConfig returns an error and fix duplicate error message 2013-09-20 12:46:24 +00:00
Michael Crosby a8b3e889ad Add lxc-conf flag to allow custom lxc options 2013-08-22 16:05:21 +00:00
Marco Hennings 8c752c9ec4 Add workdir support for the Buildfile
For consistency the Buildfile should have the option to
set the working directory.

Of course that is one option more to the buildfile,
so please tell me if we really want this to happen.
2013-08-18 20:30:19 +02:00
Victor Vieux f7288f84e1 rebase master 2013-07-24 14:38:40 +00:00
Victor Vieux e662fab1fc fix overwrites EXPOSE 2013-07-19 02:47:35 +00:00
Victor Vieux fc05cdd9f7 add VolumesFrom to MergeConfig, and test 2013-07-17 21:06:46 +00:00
Victor Vieux d60625b22c add Volumes and VolumesFrom to CompareConfig 2013-07-17 20:51:25 +00:00
Victor Vieux f8573af974 improve mergeconfig, if dns, portspec, env or volumes specify in docker run, apend and not replace 2013-07-15 13:12:33 +00:00
Guillaume J. Charmes 43d7f64c35 Hotfix: check the length of entrypoint before comparing. 2013-07-11 17:31:07 -07:00
Michael Crosby 2e7e0ebde6 Add VOLUME instruction to buildfile 2013-07-10 06:59:16 -09:00
Guillaume J. Charmes 64ecf316e8 Merge pull request #1053 from dynport/do-not-copy-hostname-from-image
do not merge hostname from image
2013-07-03 10:34:15 -07:00
Michael Crosby 742d20a803 Add Entrypoint to builder and container config
By setting an entrypoint in the Dockerfile this
allows one to run an image and only pass arguments.
2013-07-01 05:34:27 -09:00
Tobias Schwab 95d3a0eaea do not merge hostname from image 2013-06-28 15:22:01 +02:00
Will Dietz 227f0a3cf0 utils.go: Fix merge logic for user and hostname.
Fall back to image-specified hostname if user doesn't
provide one, instead of only using image-specified
hostname if the user *does* try to set one.
(ditto for username)

Closes #694.
2013-05-23 15:54:51 -05:00
Guillaume J. Charmes d8403f7129 Move docker build to client 2013-05-19 10:46:24 -07:00
Guillaume J. Charmes d08f630022 Move getKernelVersion to utils package 2013-05-15 17:40:47 -07:00
Guillaume J. Charmes a82d51d4b1 Create a subpackage for utils 2013-05-14 22:37:35 +00:00
Jérôme Petazzoni 2097003fd6 Merge branch 'master' of github.com:dotcloud/docker into 471-cpu-limit 2013-05-10 14:44:50 -07:00
Victor Vieux 6825e87878 Merge branch 'master' into remote-api 2013-05-07 21:02:32 +02:00
Jérôme Petazzoni 01e8bbbcc6 implement "-c" option to allocate a number of CPU shares to a container 2013-05-07 11:16:30 -07:00
unclejack a7672e03fa kernel version - don't show the dash if flavor is empty 2013-05-07 20:57:21 +03:00
Victor Vieux 917181273f update to master 2013-05-07 19:23:50 +02:00
shin- 195050cdc0 Implemented command 2013-05-07 03:49:08 -07:00
Guillaume J. Charmes d4ac7388cb Implement caching for docker builder 2013-05-06 16:44:37 -07:00
Guillaume J. Charmes c108b361f7 Make Builder.Build return the builded image 2013-05-06 16:00:30 -07:00
Victor Vieux 02b548aa23 removed rcli completly 2013-05-06 16:59:33 +02:00
Victor Vieux ddf25fcd9b added login and push 2013-05-06 13:34:31 +02:00
Victor Vieux ec9df66c29 bump to 0.2.2 2013-05-06 11:53:00 +02:00
Guillaume J. Charmes d125e993b7 Merge remote-tracking branch 'origin/registry-update'
+ Registry: Add the new registry support
2013-05-05 07:13:25 -07:00
shin- 02d2710347 gofmt pass 2013-05-06 10:57:36 -07:00
shin- e15af46fb0 Fixed checksum computing. Ensure checksum is computed when image metadata is loaded from disk. Fixed docker push workflow. Moved hash computing to utils 2013-05-06 10:56:10 -07:00
Harley Laue 3f4e2e5b28 Check that the line is valid with 6 parts after split 2013-05-03 13:49:10 -05:00
Harley Laue cd5e74bb7f strings.Split may return an empty string on no match
* This fixes an index out of range crash if cgroup memory is not
  enabled.
2013-05-02 14:44:41 -05:00
Victor Vieux d46e7bb847 up to date with master 2013-05-02 18:36:23 +02:00
Al Tobey 5fd1808a52 Use /proc/mounts instead of mount(8)
Specifically, Ubuntu Precise's cgroup-lite script uses mount -n
to mount the cgroup filesystems so they don't appear in mtab, so
detection always fails unless the admin updates mtab with /proc/mounts.

/proc/mounts is valid on just about every Linux machine in existence and
as a bonus is much easier to parse.

I also removed the regex in favor of a more accurate parser that should
also support monolitic cgroup mounts (e.g. mount -t cgroup none /cgroup).
2013-04-30 17:37:43 +00:00
Victor Vieux f5e3974cc1 working tty 2013-04-29 15:12:18 +02:00
Tianon Gravi fef1eefff3 Update FindCgroupMountpoint to be more forgiving
On Gentoo, the memory cgroup is mounted at /sys/fs/cgroup/memory, but the mount line looks like the following:
memory on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)

(note that the first word on the line is "memory", not "cgroup", but the other essentials are there, namely the type of cgroup and the memory mount option)
2013-04-23 01:09:29 -06:00
Guillaume J. Charmes 1eed1ecde6 Move the kernel detection to arch specific files 2013-04-22 12:08:59 -07:00
Guillaume J. Charmes 4c145238a8 Make the kernel version detection more generic 2013-04-22 11:39:56 -07:00
Guillaume J. Charmes 16e9520d75 Merge pull request #454 from tianon/master
Update utils.go to not enforce extra constraints on the kernel "flavor" (such as being integral or even comparable one to another)
2013-04-22 08:02:42 -07:00
Guillaume J. Charmes 5050dd8cf0 Do not stop execution if cgroup mountpoint is not found 2013-04-22 00:44:57 -04:00
Tianon Gravi 088d53b6fa Update utils.go to not enforce extra constraints on the kernel "flavor" (such as being integral or even comparable one to another)
This is especially to fix the current docker on kernels such as gentoo-sources, where the "flavor" is the string "gentoo", and that obviously fails to be converted to an integer.
2013-04-21 19:19:38 -06:00
Solomon Hykes 0b067a2873 'docker push' shows an additional progress bar while it buffers the archive to disk. Fixes #451. 2013-04-21 15:29:26 -07:00
Guillaume J. Charmes e0ebd9ff7e Use mount to determine the cgroup mountpoint 2013-04-18 21:57:58 -07:00
Guillaume J. Charmes 6d7394c0d7 Check kernel version and display warning if too low 2013-04-18 20:47:24 -07:00
Guillaume J. Charmes 1a0d96b31b Use integers instead of non-printable chars in the escape sequence detection 2013-04-09 12:55:26 -07:00
Guillaume J. Charmes 7bdecf7754 Remove unused optimization that could lead in loosing the escape sequence 2013-04-09 12:55:26 -07:00
Guillaume J. Charmes d4f9cccbbd Implement an escape sequence in order to be able to detach from a container 2013-04-09 11:06:17 -07:00
Dominik Honnef c1be61031a replace unreachable returns with panics
Not only is this a more common idiom, it'll make finding bugs easier,
and it'll make porting to Go 1.1 easier.

Go 1.1 will not require the final return or panic because it has a
notion of terminating statements.
2013-04-03 11:18:23 +02:00
Solomon Hykes 3d02b3c1c0 Merge remote-tracking branch 'robryk/writebroadcaster-stuff' 2013-04-02 20:35:13 -07:00
Solomon Hykes 886246e7e5 Use an environment variable to activate debug mode, instead of a package-specific flag 2013-04-02 10:58:16 -07:00
Robert Obryk bcf056683b Renamed writeBroadcaster.Close() to CloseWriters(). 2013-04-02 10:45:17 +02:00
Solomon Hykes 41ad213ebd Show shorthand image IDs for convenience. Shorthand IDs (or any non-conflicting prefix) can be used to lookup images 2013-03-31 22:11:55 -07:00
Solomon Hykes f13fe3e23b Show shorthand container IDs for convenience. Shorthand IDs (or any non-conflicting prefix) can be used to lookup containers 2013-03-31 02:02:01 -07:00
Guillaume J. Charmes adcd5a9ffb Add debug infos in CmdInfo to know the amount of fds and goroutines in use 2013-03-30 10:33:10 -07:00
Robert Obryk b695d4b48c Swapped a map for a list in writeBroadcaster. 2013-03-30 16:04:19 +01:00
Robert Obryk 239e6cccce Make writeBroadcaster safe for concurrent use. 2013-03-30 16:02:22 +01:00
Guillaume J. Charmes d2ce0225df Fix #108, reattach now works properly 2013-03-29 09:31:47 -07:00
Robert Obryk d87fb5222b Fix a race condition in bufReader.
The race condition cen be detected by running existing bufReader tests
with Go's race detector.
2013-03-29 11:00:50 +01:00
Jonathan Rudenberg 6c0ec2f878 Camelize some snake_case variable names 2013-03-28 20:12:23 -04:00
Guillaume J. Charmes 5ba8823296 Improve the debug function 2013-03-25 01:29:01 -07:00
Guillaume J. Charmes b5587a31a8 Add a Debugf() helper and a -D (debug) flag to docker 2013-03-22 11:44:12 -07:00
Solomon Hykes 5bcb0cd948 Moved Go() to the main package... And got rid of the useless docker/future package 2013-03-21 01:13:55 -07:00
Solomon Hykes 5089191e76 Moved Download() and progressReader{} to the main package 2013-03-21 00:54:54 -07:00
Solomon Hykes 1f5aaa522b Moved HumanDuration() to the main package 2013-03-21 00:52:43 -07:00
Solomon Hykes d913b3dd96 'docker pull' and 'docker put' automatically detect tar compression (gzip, bzip2 or uncompressed). -j and -z flags are no longer required. 2013-02-22 12:28:25 -08:00
Andrea Luzzardi 79ad8c7d66 utils: Added SelfPath(), which figures out the current (absolute) path of the running binary 2013-02-13 13:58:28 -08:00
Solomon Hykes f9c044dd18 'docker ps' prints shorter lines 2013-01-29 03:18:07 -08:00
Andrea Luzzardi 252f3f299f go fmt 2013-01-28 14:30:05 -08:00
Solomon Hykes 28cee802fd docker tar: stream the contents of a container as a tar archive 2013-01-27 00:59:49 -08:00
Solomon Hykes f3884d35b9 Plugged 4 more commands into the real backend: 'diff', 'reset', 'run', 'stop'. 'run' actually runs the process, but doesn't capture outptu properly, and encounters mount issues 2013-01-26 15:56:42 -08:00