mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-23 19:05:37 +00:00
commit
e4c8845091
7
Dockerfile.qemugce
Normal file
7
Dockerfile.qemugce
Normal file
@ -0,0 +1,7 @@
|
||||
# Tag: 804b2c40d078287c40aeb9166e475e843544e597
|
||||
FROM mobylinux/alpine-qemu@sha256:aaecc961a62b14ee0ecd3a4fe792af5232637f0a49f7d0f90b87acaeb6f3fa4a
|
||||
|
||||
COPY alpine/gce.img.tar.gz .
|
||||
RUN zcat gce.img.tar.gz | tar xf -
|
||||
|
||||
ENTRYPOINT [ "qemu-system-x86_64", "-serial", "stdio", "-drive", "file=disk.raw,format=raw", "-m", "2048", "-vnc", "none" ]
|
4
Makefile
4
Makefile
@ -21,6 +21,10 @@ qemu-iso: Dockerfile.qemuiso alpine/mobylinux-bios.iso
|
||||
tar cf - $^ | docker build -f Dockerfile.qemuiso -t mobyqemuiso:build -
|
||||
docker run -it --rm mobyqemuiso:build
|
||||
|
||||
qemu-gce: Dockerfile.qemugce alpine/gce.img.tar.gz
|
||||
tar cf - $^ | docker build -f Dockerfile.qemugce -t mobyqemugce:build -
|
||||
docker run -it --rm mobyqemugce:build
|
||||
|
||||
hyperkit.git:
|
||||
git clone https://github.com/docker/hyperkit.git hyperkit.git
|
||||
|
||||
|
1
alpine/.gitignore
vendored
1
alpine/.gitignore
vendored
@ -2,6 +2,7 @@
|
||||
*.tag
|
||||
*.iso
|
||||
*.vhd
|
||||
*.tar.gz
|
||||
/mobylinux-boot.vhdx
|
||||
/mobylinux.efi
|
||||
etc/moby-commit
|
||||
|
@ -16,6 +16,9 @@ BIOS_IMAGE=mobylinux/mkimage-iso-bios@sha256:7e28f7745fd62284142dce59a137c3331f7
|
||||
# Tag: 95d4fef1a9555b640b4f94a4a3968533714059fe
|
||||
PAD4_IMAGE=mobylinux/pad4@sha256:a26e02f16bdafa241a55e05fa09b9bb260e69a3a8c90418bb40b4ae936437d17
|
||||
|
||||
# Tag: df1b8ef666d66694e84f23772937ff45c46fa6c1
|
||||
GCE_IMAGE=mobylinux/mkimage-gce@sha256:b19ba24184ed5602df5b666ed475d5d7211fa67bee51d3e6380cf0380c63f65b
|
||||
|
||||
moby.img: Dockerfile mkinitrd.sh init $(ETCFILES)
|
||||
$(MAKE) -C kernel
|
||||
$(MAKE) -j -C packages
|
||||
@ -78,6 +81,12 @@ mobylinux-bios.iso: initrd.img kernel/x86_64/vmlinuz64
|
||||
tar cf - initrd.img -C kernel/x86_64 vmlinuz64 | \
|
||||
docker run --rm --net=none --log-driver=none -i $(BIOS_IMAGE) >$@
|
||||
|
||||
gce: gce.img.tar.gz
|
||||
|
||||
gce.img.tar.gz: common
|
||||
tar cf - initrd.img -C kernel/x86_64 vmlinuz64 | \
|
||||
docker run --rm --net=none --log-driver=none -i $(GCE_IMAGE) >$@
|
||||
|
||||
common: initrd.img
|
||||
$(MAKE) -C kernel
|
||||
$(MAKE) -j -C packages
|
||||
|
4
alpine/base/guestfs/Dockerfile
Normal file
4
alpine/base/guestfs/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
||||
FROM debian:jessie
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get update && apt-get -yq upgrade && apt-get install -yq libguestfs-tools syslinux linux-image-amd64 vim
|
29
alpine/base/guestfs/Makefile
Normal file
29
alpine/base/guestfs/Makefile
Normal file
@ -0,0 +1,29 @@
|
||||
.PHONY: tag push
|
||||
|
||||
BASE=debian:jessie
|
||||
IMAGE=guestfs
|
||||
|
||||
default: push
|
||||
|
||||
hash: Dockerfile
|
||||
DOCKER_CONTENT_TRUST=1 docker pull $(BASE)
|
||||
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
|
||||
docker run --rm $(IMAGE):build sh -c 'apt list --installed 2>/dev/null | sha1sum' | sed 's/ .*//' > hash
|
||||
|
||||
push: hash
|
||||
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
|
||||
(docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash) && \
|
||||
docker push mobylinux/$(IMAGE):$(shell cat hash))
|
||||
docker rmi $(IMAGE):build
|
||||
rm -f hash
|
||||
|
||||
tag: hash
|
||||
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
|
||||
docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash)
|
||||
docker rmi $(IMAGE):build
|
||||
rm -f hash
|
||||
|
||||
clean:
|
||||
rm -f hash
|
||||
|
||||
.DELETE_ON_ERROR:
|
10
alpine/base/mkimage-gce/Dockerfile
Normal file
10
alpine/base/mkimage-gce/Dockerfile
Normal file
@ -0,0 +1,10 @@
|
||||
# Tag: 8719f0f33b3cf9d59a62be64a42220978ac96486
|
||||
FROM mobylinux/guestfs@sha256:c7229f01c1a54270d2bc3597c30121628c18db211ed32fb7202823b6eaa4f853
|
||||
|
||||
WORKDIR /tmp/image
|
||||
|
||||
COPY . .
|
||||
|
||||
COPY make-gce /usr/bin
|
||||
|
||||
CMD [ "/usr/bin/make-gce" ]
|
27
alpine/base/mkimage-gce/Makefile
Normal file
27
alpine/base/mkimage-gce/Makefile
Normal file
@ -0,0 +1,27 @@
|
||||
.PHONY: tag push
|
||||
|
||||
IMAGE=mkimage-gce
|
||||
|
||||
default: push
|
||||
|
||||
hash: Dockerfile make-gce syslinux.cfg
|
||||
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
|
||||
docker run --rm $(IMAGE):build sh -c "(cat $^; apt list --installed 2>/dev/null) | sha1sum" | sed 's/ .*//' > hash
|
||||
|
||||
push: hash
|
||||
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
|
||||
(docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash) && \
|
||||
docker push mobylinux/$(IMAGE):$(shell cat hash))
|
||||
docker rmi $(IMAGE):build
|
||||
rm -f hash
|
||||
|
||||
tag: hash
|
||||
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
|
||||
docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash)
|
||||
docker rmi $(IMAGE):build
|
||||
rm -f hash
|
||||
|
||||
clean:
|
||||
rm -f hash
|
||||
|
||||
.DELETE_ON_ERROR:
|
25
alpine/base/mkimage-gce/make-gce
Executable file
25
alpine/base/mkimage-gce/make-gce
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
# input is a tarball of vmlinuz64 and initrd.img on stdin
|
||||
# output is a compressed tarball of a raw disk image on stdout
|
||||
|
||||
mkdir -p files
|
||||
tar xf - -C files
|
||||
|
||||
cp syslinux.cfg files
|
||||
|
||||
tar cf files.tar -C files .
|
||||
|
||||
virt-make-fs --size=1G --type=ext4 --partition files.tar disk.raw
|
||||
|
||||
guestfish -a disk.raw -m /dev/sda1 <<EOF
|
||||
upload /usr/lib/SYSLINUX/mbr.bin /mbr.bin
|
||||
copy-file-to-device /mbr.bin /dev/sda size:440
|
||||
rm /mbr.bin
|
||||
extlinux /
|
||||
part-set-bootable /dev/sda 1 true
|
||||
EOF
|
||||
|
||||
tar cf - disk.raw | gzip -9
|
5
alpine/base/mkimage-gce/syslinux.cfg
Normal file
5
alpine/base/mkimage-gce/syslinux.cfg
Normal file
@ -0,0 +1,5 @@
|
||||
DEFAULT linux
|
||||
LABEL linux
|
||||
KERNEL /vmlinuz64
|
||||
INITRD /initrd.img
|
||||
APPEND earlyprintk=ttyS0,115200 console=ttyS0,115200
|
Loading…
Reference in New Issue
Block a user