mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-26 04:03:11 +00:00
Merge pull request #579 from justincormack/vhdfix2
Use alpine to do raw2vhd
This commit is contained in:
commit
56e0bdad03
@ -5,9 +5,9 @@ IMAGE=alpine-base
|
|||||||
|
|
||||||
default: push
|
default: push
|
||||||
|
|
||||||
hash:
|
hash: Dockerfile repositories
|
||||||
docker pull $(BASE)
|
docker pull $(BASE)
|
||||||
tar cf - Dockerfile repositories | docker build --no-cache -t $(IMAGE):build -
|
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
|
||||||
docker run --rm $(IMAGE):build sha1sum /lib/apk/db/installed | sed 's/ .*//' > hash
|
docker run --rm $(IMAGE):build sha1sum /lib/apk/db/installed | sed 's/ .*//' > hash
|
||||||
|
|
||||||
push: hash
|
push: hash
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
FROM alpine:3.4
|
FROM alpine:3.4
|
||||||
|
|
||||||
|
COPY repositories /etc/apk/
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
apk update && apk upgrade && \
|
apk update && apk upgrade && \
|
||||||
apk add \
|
apk add --no-cache \
|
||||||
qemu-img \
|
qemu-img@edge \
|
||||||
qemu-system-arm \
|
qemu-system-arm@edge \
|
||||||
qemu-system-x86_64 \
|
qemu-system-x86_64@edge \
|
||||||
&& rm -rf /var/cache/apk/*
|
&& true
|
||||||
|
@ -5,9 +5,9 @@ IMAGE=alpine-qemu
|
|||||||
|
|
||||||
default: push
|
default: push
|
||||||
|
|
||||||
hash:
|
hash: Dockerfile repositories
|
||||||
docker pull $(BASE)
|
docker pull $(BASE)
|
||||||
tar cf - Dockerfile | docker build --no-cache -t $(IMAGE):build -
|
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
|
||||||
docker run --rm $(IMAGE):build sha1sum /lib/apk/db/installed | sed 's/ .*//' > hash
|
docker run --rm $(IMAGE):build sha1sum /lib/apk/db/installed | sed 's/ .*//' > hash
|
||||||
|
|
||||||
push: hash
|
push: hash
|
||||||
|
2
alpine/base/alpine-qemu/repositories
Normal file
2
alpine/base/alpine-qemu/repositories
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
http://dl-cdn.alpinelinux.org/alpine/v3.4/main
|
||||||
|
@edge http://dl-cdn.alpinelinux.org/alpine/edge/main
|
@ -1,17 +1,5 @@
|
|||||||
FROM debian:jessie
|
FROM mobylinux/alpine-qemu:0e5f8a908e7976c3a6ab725b7267ab725e89c6ae
|
||||||
|
|
||||||
# Why bother with this whole song and dance? qemu-img versions >=2.2.1 have a
|
|
||||||
# "bug" which causes the generated VHD files to be improperly formatted for
|
|
||||||
# running on Azure: https://bugs.launchpad.net/qemu/+bug/1490611
|
|
||||||
#
|
|
||||||
# Since Alpine has only qemu-img >= 2.4.1 in its apk index, we cannot use
|
|
||||||
# Alpine.
|
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get install -y qemu-utils
|
|
||||||
|
|
||||||
# If version changes in distributed packages, this build is busted. Sanity check.
|
|
||||||
RUN qemu-img --version
|
|
||||||
RUN qemu-img --version | awk '{ if ($3 != "2.1.2,") exit 1; }'
|
|
||||||
COPY ./cloud/azure/raw2vhd.sh /raw2vhd.sh
|
COPY ./cloud/azure/raw2vhd.sh /raw2vhd.sh
|
||||||
|
|
||||||
VOLUME ["/tmp"]
|
VOLUME ["/tmp"]
|
||||||
|
@ -3,5 +3,5 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
>&2 echo "Converting raw image file to VHD..."
|
>&2 echo "Converting raw image file to VHD..."
|
||||||
qemu-img convert -f raw -O vpc -o subformat=fixed /tmp/mobylinux.img /tmp/mobylinux.vhd 1>&2
|
qemu-img convert -f raw -O vpc -o subformat=fixed,force_size /tmp/mobylinux.img /tmp/mobylinux.vhd 1>&2
|
||||||
>&2 echo "Done converting to VHD."
|
>&2 echo "Done converting to VHD."
|
||||||
|
Loading…
Reference in New Issue
Block a user