Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ogerardin/fb3b615a1a1daaec31966edbb47681c0 to your computer and use it in GitHub Desktop.
Save ogerardin/fb3b615a1a1daaec31966edbb47681c0 to your computer and use it in GitHub Desktop.
Running Docker in Alpine Linux running in QEMU on Windows (64 bits)
Download latest qemu-w64-setup-*.exe from https://qemu.weilnetz.de/w64
Extract qemu-w64-setup-*.exe using 7-Zip to a directory named "qemu"
Download Alpine ISO image (Extended) for x86_64 from https://alpinelinux.org/downloads/
Create disk image using "qemu-img create hd.img 10G"
Copy start.bat next to ISO image and hd.img, adjust qemu path if required
Start QEMU using start.bat
(Let Alpine Linux boot from ISO)
Login using "root" (no password)
Start setup by entering "setup-alpine"
Accept default answer for all questions except where required (new root password, proxy, ...)
When asked "which disk would you like to use?" enter "sda"
When asked "How would you like to use it?" enter "sys"
Confirm disk will be erased
(wait for installation to complete with message "Installation is complete. Please reboot")
Enter "reboot"
(Let Alpine Linux boot from disk image now)
Login using root/(password you chose previously)
[SSH access]
Enable root access over SSH as per https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/v2v_guide/preparation_before_the_p2v_migration-enable_root_login_over_ssh
Connect from the host using any ssh client: "ssh root@localhost -p 22022"
Install Docker as per https://wiki.alpinelinux.org/wiki/Docker
[proxy] if running behind a proxy:
Edit /etc/conf.d/docker, add the following line: export http_proxy=http://<host>:<port>
Edit /etc/rc.conf, find the line with rc_env_allow and change it to: rc_env_allow="http_proxy https_proxy"
Enter "docker -D info" and make sure you have a line with "HTTP Proxy: (...)"
Test docker with "docker run hello-world"
..\qemu\qemu-system-x86_64.exe -m 2G -k none -nic user,ipv6=off,hostfwd=tcp::22022-:22 -boot order=cd -drive file=hd.img,format=raw,index=0,media=disk -cdrom alpine-extended-3.7.0-x86_64.iso
@if errorlevel 1 pause
@misterpah
Copy link

great ! i always want to do this

@ogerardin
Copy link
Author

@misterpah

great ! i always want to do this

Some things might have changed since then, let me know how it goes for you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment