Commit Graph

165 Commits

Author SHA1 Message Date
Rolf Neugebauer
a42a3ffb39 cmd: Add initial Hyper-V run backend
The Hyper-V backend is loosly based on the docker-machine code
as well as ./scripts/LinuxKit.ps1. It shells out to Powershell
for most of the configuration.

Console is provided by github.com/Azure/go-ansiterm/winterm
and the ode surrounding it is loosely based on the equivalent
code in containerd and moby/moby.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-06-11 09:11:06 +01:00
Rolf Neugebauer
309ae23c2e cmd: Use github.com/rn/iso9660wrap for metadata
The repository was moved...

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-06-11 09:11:06 +01:00
Rolf Neugebauer
ce8de92978 cmd: Fix disk "size" handling
commit bdf9b1f31a introduced a bug with disk size handling
where GB was not handled correctly. Fix it.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-06-11 09:11:06 +01:00
Rolf Neugebauer
bdf9b1f31a cmd: Default disk "size" parameter to GB
Most cloud providers allow disk size allocation on in units
of GB. Make it the default for linuxkit disk "size" arguments.
Users can override the unit by appending a M to the disk size.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-06-09 11:51:48 +01:00
Riyaz Faizullabhoy
d31413c39c Merge pull request #1973 from kencochrane/fix_aws_name
Added more log statements to linuxkit push aws command
2017-06-06 13:31:22 -07:00
Ken Cochrane
67c2a230fb Fixed AWS push command, name wasn't set correctly
Signed-off-by: Ken Cochrane <kencochrane@gmail.com>
2017-06-06 15:50:25 -04:00
Justin Cormack
3f8d627be6 Merge pull request #1969 from DieterReuter/fix-aws-default-img-name
Fix empty AWS default image name
2017-06-06 19:25:57 +01:00
Dieter Reuter
fc5135b5cc Fix empty AWS default image name
Signed-off-by: Dieter Reuter <dieter.reuter@me.com>
2017-06-06 19:10:21 +02:00
thebsdbox
7cc2bc43e4 Added capability to wait for the OpenVM tools to report the IP of new VM
Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-06-06 17:52:18 +01:00
Justin Cormack
d617db19bf Merge pull request #1964 from dave-tucker/aws
Add AWS Support to LinuxKit Push and Run
2017-06-06 12:06:50 +01:00
Dave Tucker
8f4408310d docs: Add basic docs for AWS support
Signed-off-by: Dave Tucker <dt@docker.com>
2017-06-06 10:36:43 +01:00
Dave Tucker
719f260e01 linuxkit: Order push/run backends and cases alphabetically
This makes it easier to identify where a new backend should be added.
It's also simpler to match help text and case statements.

Signed-off-by: Dave Tucker <dt@docker.com>
2017-06-06 10:36:43 +01:00
Dave Tucker
3dcd8a2730 linuxkit: Add run support for AWS
Signed-off-by: Dave Tucker <dt@docker.com>
2017-06-06 10:36:31 +01:00
Dave Tucker
0737694eb7 linuxkit: Add push support for AWS
Signed-off-by: Dave Tucker <dt@docker.com>
2017-06-06 10:06:28 +01:00
Justin Cormack
12a2ea5143 Merge pull request #1959 from justincormack/mobyup
Update moby tool and qemu fixes
2017-06-05 17:42:06 +01:00
Justin Cormack
e782a469d5 Update moby tool and qemu fixes
- no longer uses several of the `mkimage-*` tools in favour of dogfooding
with `linuxkit` and using the `mkimage` package.
- fix the qemu docker container fallbacks to work better when multiple
paths are used for disks and the image.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-05 16:34:26 +01:00
radu-matei
0f2e41f138 Add Azure push and run
azure: React to change requests

azure: Fix push and run message and update example

azure: Remove docker dependency and upload VHD

Modify %s to %v for Go errors

Signed-off-by: radu-matei <matei.radu94@gmail.com>
2017-06-02 14:41:28 +03:00
Justin Cormack
583c5755fa Merge pull request #1944 from justincormack/qemu-multiple-disks
Support multiple disks in qemu
2017-06-01 14:17:51 +01:00
Justin Cormack
25a1e12cf3 Support multiple disks in qemu
This changes the CLI specification for disks, as it needs to be able to
be repeated.

```
linuxkit run qemu -disk name,size=1G,format=qcow2 ...
```

Options may be omitted.

Currently other local backends may not support multiple disks, but this
can be added in future. Code for cloud backends has not changed as the
disk support is specific to the platform.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-01 13:40:20 +01:00
Riyaz Faizullabhoy
abb19f847d Merge pull request #1929 from thebsdbox/push_vcenter
vCenter push capability
2017-05-31 13:41:24 -07:00
thebsdbox
6d9a3c5312 vCenter push capability
Re-factored the `run` code to create the `push` functionality.

Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-05-31 21:04:27 +01:00
Riyaz Faizullabhoy
c983441dae Merge pull request #1935 from thebsdbox/pushUsageFix
Fix correct usage function
2017-05-30 12:00:33 -07:00
Rolf Neugebauer
cbecd19c51 cli: Update qemu runner to use the new qemu image
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-30 17:15:13 +01:00
thebsdbox
9e7214a1f8 Fix correct usage function
This fixes the push function as it currently gives the help for `run`
not `push`.

Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-05-30 15:56:01 +01:00
Rolf Neugebauer
360e9870d6 Merge pull request #1926 from MagnusS/no-networking
hyperkit: Add --networking option
2017-05-29 19:23:52 +01:00
Magnus Skjegstad
eadb3066f3 hyperkit: Add --networking option
Adds a new --networking option to simplify selection of networking modes
for `linuxkit run hyperkit`. The new modes are "docker-for-mac",
"vpnkit" and "none".

By default docker-for-mac will be used for networking. HyperKit will
then connect to the default VPNKit socket location used by Docker for
Mac.

In vpnkit-mode a new VPNKit instance is started and the socket
"vpnkit_eth.sock" is created in the state directory. This mode also
enables port forwarding via 9p and vsock. The vpnkit mode optionally
accepts a path to an existing VPNKit socket. This allows two or more VMs
to be connected to the same virtual network - but only the VM that
created the the socket can use port forwarding.

Mode "none" disables networking.

Signed-off-by: Magnus Skjegstad <magnus@skjegstad.com>
2017-05-29 19:49:13 +02:00
thebsdbox
bbde9f5baa Fixes disk size output typo
The error was incorrect when unable to parse the disk size.

Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-05-29 14:15:56 +01:00
Justin Cormack
4e32ad7817 Only output qemu disk creation info in debug mode
As I am using this command in the internals of `moby` the
verboseness is annoying.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-26 16:43:49 +01:00
Magnus Skjegstad
938091c9fb linuxkit: add -vpnkit-socket flag
Add a new flag to set the VPNKit ethernet socket path. Defaults to the
standard location for the socket in Docker for Mac.

This flag can be used to connect to the VPNKit instance started by
another linuxkit VM launched with `-start-vpnkit`. VMs connected to the
same VPNKit instance will be on the same virtual internal network.

Signed-off-by: Magnus Skjegstad <magnus@skjegstad.com>
2017-05-26 13:06:26 +02:00
Rolf Neugebauer
df141841c5 Merge pull request #1891 from MagnusS/add-9p-linuxkit
Add -start-vpnkit flag to linuxkit run hyperkit
2017-05-26 10:34:59 +01:00
Magnus Skjegstad
9c4dc38883 linuxkit: add -start-vpnkit flag
Adds a flag to launch a new vpnkit instance. This enables port
forwarding via a 9p mount (tag:port) if the guest supports it. Vsock
port 62373 is also opened so vpnkit can forward connections back to the
guest.

If -start-vpnkit is not specified HyperKit will connect to the
vpnkit instance managed by Docker for Mac, as before.

Signed-off-by: Magnus Skjegstad <magnus@skjegstad.com>
2017-05-26 10:09:21 +02:00
thebsdbox
6fe7d0e66f Adding of VMware govmomi to vendors
Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-05-25 08:48:48 +01:00
thebsdbox
1e6243357f VMware vCenter run capability
Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-05-24 18:35:01 +01:00
Rolf Neugebauer
f90fde5a6f cmd: Unify disk command line options for local hypervisors
- '-disk-size' is now defaults to MB (but can be GB when appending 'G')
- The disk will be created if it doesn't exist (didn't happen in qemu)

Update the documentation.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-24 16:05:06 +01:00
Justin Cormack
838d845003 Clean up of Qemu run
For all output formats except kernel+initrd, you must use the full path of
the file they want to run. Make the options auto detect.

Split the uefi option to mean "use uefi firmware" not be ISO specific.

Allow specifying a bootable disk image, so we can test disk image output
formats with qemu too.

Add a test case for qcow2 boot under qemu.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-23 09:22:39 +01:00
Justin Cormack
8afd318e97 Fixes for running qemu-img in a container
- show errors by outputting stderr
- as no input is wired up, fails as requests a tty, so don't do that

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-22 14:36:00 +01:00
Justin Cormack
809213230d Allow specifying the format of a qemu drive
Default remains qcow2 but you can specify raw or other supported formats.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-22 11:16:20 +01:00
Ian Campbell
2df30ac26c Pass --tty to docker run when running Qemu via a container
Otherwise escape codes (arrow keys etc) do not work.

This is done only when stdin is a tty.

For clarity spell `--tty-` and `--interactive` out in full rather than using
the short versions.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-05-18 21:07:22 +01:00
Ian Campbell
bb787b49be Allow forcing qemu backend to use container via command line
`linuxkit run --containerized foo`

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-05-18 17:19:01 +01:00
Magnus Skjegstad
f0e7e41424 linuxrun: add -vsock-ports option to HyperKit
When `-vsock-ports` is specified, the listed guest vsock
ports will be made available through unix domain sockets
in the state directory.

Signed-off-by: Magnus Skjegstad <magnus@skjegstad.com>
2017-05-15 20:14:30 +02:00
Rolf Neugebauer
a16d1683f8 cmd: Add a -state argument to VMware runner
The state directory is used to store any user data disk images
and the .vmx file. At run time, it is also used to keep
various other files, such as the nvram, log and lock files, etc.

While at it, also clean up the code a little more and fix the
handling of the "-disk-size" argument when no "-disk" argument
is specified. This brings it in line with the other runners.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-15 12:13:55 +01:00
Rolf Neugebauer
243967db6f cmd: Unify the coding style somewhat
There is no need to prefix local variables and try to name
variables which refer to the same/simialr thing the same
across runners.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-15 12:09:48 +01:00
Rolf Neugebauer
5231e06dec cmd: Add a -state option to hyperkit runner (and enable vsock)
The state directory is used to store:
- the disk image, if not specified via '-disk'
- the ISO for metadata, if '-data' is used
- the Unix domain socket for virtio sockets
- the PID of the hyperkit process
- a JSON file with the hyperkit configuration

This patch also enables the virtio socket device for the VM.

While at it, also fix .gitignore to ignore kernel images again.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-15 12:09:48 +01:00
Justin Cormack
b86fcd5253 Merge pull request #1813 from thebsdbox/vmware_disk_fix
Added matching capability to create a disk
2017-05-14 10:39:54 +01:00
thebsdbox
3e9a0ae94c Added matching capability to create a disk
- What I did
Added the capability to re-use or create a disk from the linuxkit
VMware cli

- How I did it
Using the vmware-diskmanager that comes with Fusion/Workstation

- How to verify it
Run linuxkit run vmware with the -disk -disk-size arguments

- Description for the changelog
Persistent disk functionality added into the VMware backend.

- A picture of a cute animal (not mandatory but encouraged)
nope

Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-05-13 19:29:55 +01:00
Dave Tucker
7027dc814c Fix path handling in QEMU to allow containers outside the PWD
Signed-off-by: Dave Tucker <dt@docker.com>
2017-05-12 20:12:59 +01:00
Ian Campbell
c1ce8b4688 Consolidate metadata ISO writing into a single function
Used by both `metadata create` and the hyperkit runner.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-05-11 19:25:28 +01:00
Ian Campbell
36eaa44d7e Add linuxkit metadata command
Only subcommand is currently `create` which is a thin wrapper to create an iso
file in the format expected by `pkg/metadata`.

Currently very basic and just takes the content on the command line but could
be extended to read from a file etc.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-05-11 19:25:27 +01:00
Justin Cormack
56e30fdbc5 Clean up initrd creation library
Remove duplicated code and clean up file handling a little.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-09 13:30:14 +01:00
Justin Cormack
fb3dab399d Code in the initrd generator to split a single tarball
In the WIP code in `moby` we now have a standard base tarball format,
that includes the kernel and cmdline as files in `/boot` so that the
entire output of the yaml file can default to a single tarball. Then
this can be split back up by LinuxKit into initrd, kernel and cmdline
as needed. This will probably become the only output of the `moby build`
stage, with a `moby package` stage dealing with output formats.

We may remove the output format specification from the yaml file as well,
and just have it in the command.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-08 16:15:50 +01:00