Skip to content

Instantly share code, notes, and snippets.

@ijc
Created May 18, 2017 17:43
Show Gist options
  • Save ijc/00933dc2957f772104ff7cbf663b2f43 to your computer and use it in GitHub Desktop.
Save ijc/00933dc2957f772104ff7cbf663b2f43 to your computer and use it in GitHub Desktop.
use Debian base for LinuxKit's qemu container
diff --git a/src/cmd/linuxkit/run_qemu.go b/src/cmd/linuxkit/run_qemu.go
index 1de297a9..bbdddc20 100644
--- a/src/cmd/linuxkit/run_qemu.go
+++ b/src/cmd/linuxkit/run_qemu.go
@@ -14,7 +14,7 @@ import (
)
// QemuImg is the version of qemu container
-const QemuImg = "linuxkit/qemu:17f052263d63c8a2b641ad91c589edcbb8a18c82"
+const QemuImg = "linuxkit/qemu-deb:51c94165708d0decc7120643b4851d4de262599b"
// QemuConfig contains the config for Qemu
type QemuConfig struct {
diff --git a/tools/qemu/Dockerfile.deb b/tools/qemu/Dockerfile.deb
new file mode 100644
index 00000000..b1854a12
--- /dev/null
+++ b/tools/qemu/Dockerfile.deb
@@ -0,0 +1,9 @@
+FROM debian:jessie
+
+RUN \
+ apt-get update && apt-get install -y \
+ qemu-system-x86 \
+ qemu-utils \
+ && true
+
+COPY . .
diff --git a/tools/qemu/Makefile b/tools/qemu/Makefile
index 081ab654..9ad67094 100644
--- a/tools/qemu/Makefile
+++ b/tools/qemu/Makefile
@@ -1,14 +1,14 @@
.PHONY: tag push
-BASE=alpine:3.5
-IMAGE=qemu
+BASE=debian:jessie
+IMAGE=qemu-deb
default: push
-hash: Dockerfile repositories
+hash: Dockerfile.deb repositories
DOCKER_CONTENT_TRUST=1 docker pull $(BASE)
- tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
- docker run --rm --entrypoint /bin/sh $(IMAGE):build -c 'cat Dockerfile /lib/apk/db/installed | sha1sum' | sed 's/ .*//' > $@
+ tar cf - $^ | docker build --no-cache -f Dockerfile.deb -t $(IMAGE):build -
+ docker run --rm --entrypoint /bin/sh $(IMAGE):build -c '(cat Dockerfile; dpkg --get-selections) | sha1sum' | sed 's/ .*//' > $@
push: hash
docker pull linuxkit/$(IMAGE):$(shell cat hash) || \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment