mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 18:11:35 +00:00
commit
cf809a6eb8
16
Makefile
16
Makefile
@ -1,5 +1,5 @@
|
|||||||
.PHONY: default all
|
.PHONY: default all
|
||||||
default: bin/moby
|
default: bin/moby moby-initrd.img
|
||||||
all: default
|
all: default
|
||||||
|
|
||||||
GO_COMPILE=mobylinux/go-compile:236629d9fc0779db9e7573ceb8b0e92f08f553be@sha256:16020c2d90cecb1f1d2d731187e947535c23f38b62319dd386ae642b4b32e1fb
|
GO_COMPILE=mobylinux/go-compile:236629d9fc0779db9e7573ceb8b0e92f08f553be@sha256:16020c2d90cecb1f1d2d731187e947535c23f38b62319dd386ae642b4b32e1fb
|
||||||
@ -14,8 +14,6 @@ endif
|
|||||||
bin/moby: $(MOBY_DEPS) | bin
|
bin/moby: $(MOBY_DEPS) | bin
|
||||||
tar cf - $(MOBY_DEPS) | docker run --rm --net=none --log-driver=none -i $(CROSS) $(GO_COMPILE) --package github.com/docker/moby -o $@ | tar xf -
|
tar cf - $(MOBY_DEPS) | docker run --rm --net=none --log-driver=none -i $(CROSS) $(GO_COMPILE) --package github.com/docker/moby -o $@ | tar xf -
|
||||||
|
|
||||||
QEMU_IMAGE=mobylinux/qemu:156d2160c2ccf4d5118221bc2708f6c0981d54cc@sha256:e1345ba0400d6c45bf3bdf4f4ed425c3d7596d11e6553b83f17f5893dfc49f7b
|
|
||||||
|
|
||||||
moby-initrd.img: bin/moby moby.yaml
|
moby-initrd.img: bin/moby moby.yaml
|
||||||
$^
|
$^
|
||||||
|
|
||||||
@ -28,11 +26,11 @@ test-bzImage: test-initrd.img
|
|||||||
|
|
||||||
# interactive versions need to use volume mounts
|
# interactive versions need to use volume mounts
|
||||||
.PHONY: qemu qemu-iso
|
.PHONY: qemu qemu-iso
|
||||||
qemu: moby-initrd.img
|
qemu: moby-initrd.img moby-bzImage
|
||||||
docker run -it --rm -v $(CURDIR)/moby-initrd.img:/tmp/initrd.img -v $(CURDIR)/moby-bzImage:/tmp/vmlinuz64 $(QEMU_IMAGE)
|
./scripts/qemu.sh $^
|
||||||
|
|
||||||
qemu-iso: alpine/mobylinux-bios.iso
|
qemu-iso: alpine/mobylinux-bios.iso
|
||||||
docker run -it --rm -v $(CURDIR)/mobylinux-bios.iso:/tmp/mobylinux-bios.iso $(QEMU_IMAGE)
|
./scripts/qemu.sh $^
|
||||||
|
|
||||||
bin:
|
bin:
|
||||||
mkdir -p $@
|
mkdir -p $@
|
||||||
@ -58,8 +56,8 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: hyperkit hyperkit-test
|
.PHONY: hyperkit hyperkit-test
|
||||||
hyperkit: scripts/hyperkit.sh bin/com.docker.hyperkit bin/vpnkit alpine/initrd.img kernel/x86_64/vmlinuz64
|
hyperkit: scripts/hyperkit.sh bin/com.docker.hyperkit bin/vpnkit moby-initrd.img moby-bzImage
|
||||||
./scripts/hyperkit.sh
|
./scripts/hyperkit.sh moby
|
||||||
|
|
||||||
define check_test_log
|
define check_test_log
|
||||||
@cat $1 |grep -q 'Moby test suite PASSED'
|
@cat $1 |grep -q 'Moby test suite PASSED'
|
||||||
@ -72,7 +70,7 @@ hyperkit-test: scripts/hyperkit.sh bin/com.docker.hyperkit bin/vpnkit test-initr
|
|||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test: test-initrd.img test-bzImage
|
test: test-initrd.img test-bzImage
|
||||||
tar cf - $^ | docker run --rm -i $(QEMU_IMAGE) 2>&1 | tee test.log
|
tar cf - $^ | ./scripts/qemu.sh 2>&1 | tee test.log
|
||||||
$(call check_test_log, test.log)
|
$(call check_test_log, test.log)
|
||||||
|
|
||||||
.PHONY: ebpf
|
.PHONY: ebpf
|
||||||
|
17
README.md
17
README.md
@ -1,14 +1,11 @@
|
|||||||
Moby, the Linux distro for Docker editions
|
Moby, a toolkit for custom Linux distributions
|
||||||
|
|
||||||
Simple build instructions: use `make` to build. `make qemu` will boot up in qemu in a container.
|
Simple build instructions: use `make` to build.
|
||||||
|
|
||||||
Requires GNU `make`, GNU `tar` (not Busybox tar), Docker to build.
|
`make qemu` will boot up a sample in qemu in a container; on OSX `make hyperkit` will
|
||||||
|
boot up in hyperkit. `make test` or `make hyperkit-test` will run the test suite.
|
||||||
|
|
||||||
- 1.12.x branch for Desktop stable 1.12 edition
|
Requires GNU `make`, GNU or BSD `tar` (not Busybox tar) and Docker to build.
|
||||||
- 1.13.x branch for Desktop and Cloud 1.13; also supports 1.12 CS.
|
|
||||||
- master for 1.14 development
|
|
||||||
|
|
||||||
Several kernel variants are supported:
|
To customise, copy or modify the `moby.yaml` and then run `./bin/moby file.yaml` to
|
||||||
- default
|
generate. You can run the output with `./scripts/qemu.sh` or `./scripts/hyperkit.sh`.
|
||||||
- `make LTS4.4=1` 4.4 LTS series
|
|
||||||
- `make AUFS=1` supports AUFS (deprecated)
|
|
||||||
|
35
scripts/qemu.sh
Executable file
35
scripts/qemu.sh
Executable file
@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
QEMU_IMAGE=mobylinux/qemu:156d2160c2ccf4d5118221bc2708f6c0981d54cc@sha256:e1345ba0400d6c45bf3bdf4f4ed425c3d7596d11e6553b83f17f5893dfc49f7b
|
||||||
|
|
||||||
|
# if not interactive
|
||||||
|
if [ ! -t 0 -a -z "$1" ]
|
||||||
|
then
|
||||||
|
# non interactive, tarball input
|
||||||
|
docker run -i --rm "$QEMU_IMAGE"
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
|
||||||
|
FILE=$1
|
||||||
|
FILE2=$2
|
||||||
|
[ -z "$FILE" ] && FILE="$PWD/moby"
|
||||||
|
|
||||||
|
BASE=$(basename "$FILE")
|
||||||
|
DIR=$(dirname "$FILE")
|
||||||
|
if [ ! -f "$FILE" -a -f $DIR/$BASE-initrd.img -a -f $DIR/$BASE-bzImage ]
|
||||||
|
then
|
||||||
|
FILE=$DIR/$BASE-initrd.img
|
||||||
|
FILE2=$DIR/$BASE-bzImage
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$FILE" | grep -q '^/' || FILE="$PWD/$FILE"
|
||||||
|
if [ ! -z "$FILE2" ]
|
||||||
|
then
|
||||||
|
echo "$FILE2" | grep -q '^/' || FILE2="$PWD/$FILE2"
|
||||||
|
fi
|
||||||
|
|
||||||
|
BASE=$(basename "$FILE")
|
||||||
|
MOUNTS="-v $FILE:/tmp/$BASE"
|
||||||
|
BASE2=$(basename "$FILE2")
|
||||||
|
[ ! -z "$FILE2" ] && MOUNTS="$MOUNTS -v $FILE2:/tmp/$BASE2"
|
||||||
|
docker run -it --rm $MOUNTS "$QEMU_IMAGE"
|
Loading…
Reference in New Issue
Block a user