Skip to content

Commit

Permalink
Merge pull request #78 from bargees/update-docker
Browse files Browse the repository at this point in the history
Make another Barge OS with the latest docker binary
  • Loading branch information
ailispaw authored Jun 27, 2018
2 parents 2b4e79b + ef6e76b commit 802b717
Show file tree
Hide file tree
Showing 6 changed files with 431 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
.gitignore
.vagrant/

contrib/
docs/
output/
LICENSE
Expand Down
7 changes: 7 additions & 0 deletions contrib/update-docker/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**/.DS_Store

.vagrant/

Makefile
README.md
Vagrantfile
44 changes: 44 additions & 0 deletions contrib/update-docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM ailispaw/ubuntu-essential:14.04-nodoc

RUN apt-get -q update && \
apt-get -q -y install --no-install-recommends cpio xz-utils syslinux xorriso && \
apt-get clean && rm -rf /var/lib/apt/lists/*

ENV SRCDIR /usr/src
WORKDIR ${SRCDIR}

RUN mkdir -p root
ADD rootfs.tar.xz ${SRCDIR}/root/

COPY docker ${SRCDIR}/root/etc/init.d/docker
COPY docker.tgz /tmp
RUN cd /tmp && \
tar -zxf docker.tgz -C ${SRCDIR}/root/usr/bin --strip-components=1

COPY docker.bash-completion ${SRCDIR}/root/usr/share/bash-completion/completions/docker

ENV ISO /iso

RUN mkdir -p ${ISO}/boot && \
cd root && find | cpio -H newc -o | xz -9 -C crc32 -c > ${ISO}/boot/initrd

COPY bzImage ${ISO}/boot/

RUN mkdir -p ${ISO}/boot/isolinux && \
cp /usr/lib/syslinux/isolinux.bin ${ISO}/boot/isolinux/ && \
cp /usr/lib/syslinux/linux.c32 ${ISO}/boot/isolinux/ldlinux.c32

COPY isolinux.cfg ${ISO}/boot/isolinux/

# Copied from boot2docker, thanks.
RUN cd ${ISO} && \
xorriso \
-publisher "A.I. <ailis@paw.zone>" \
-as mkisofs \
-l -J -R -V "BARGE" \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \
-isohybrid-mbr /usr/lib/syslinux/isohdpfx.bin \
-no-pad -o /barge-x.iso $(pwd)

CMD ["cat", "/barge-x.iso"]
33 changes: 33 additions & 0 deletions contrib/update-docker/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
BARGE_VERSION := 2.9.0
DOCKER_CHANNEL := stable
DOCKER_VERSION := 18.03.1-ce

ISO_NAME := barge-x.iso

EXTERNAL_DEPENDENCIES := bzImage rootfs.tar.xz isolinux.cfg docker.tgz docker.bash-completion

iso: $(ISO_NAME)

$(ISO_NAME): Dockerfile docker $(EXTERNAL_DEPENDENCIES)
docker build -t barge-x .
docker run --rm barge-x > $@

bzImage rootfs.tar.xz:
curl -L https://github.com/bargees/barge-os/releases/download/$(BARGE_VERSION)/$(@F) -o $@

isolinux.cfg:
curl -L https://raw.githubusercontent.com/bargees/barge-os/$(BARGE_VERSION)/configs/$(@F) -o $@

docker.tgz:
curl -L https://download.docker.com/linux/static/$(DOCKER_CHANNEL)/x86_64/docker-$(DOCKER_VERSION).tgz -o $@

docker.bash-completion:
curl -L https://raw.githubusercontent.com/docker/docker-ce/v$(DOCKER_VERSION)/components/cli/contrib/completion/bash/docker -o $@

clean:
$(RM) $(EXTERNAL_DEPENDENCIES)

distclean: clean
$(RM) $(ISO_NAME)

.PHONY: clean distclean
23 changes: 23 additions & 0 deletions contrib/update-docker/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# A dummy plugin for Barge to set hostname and network correctly at the very first `vagrant up`
module VagrantPlugins
module GuestLinux
class Plugin < Vagrant.plugin("2")
guest_capability("linux", "change_host_name") { Cap::ChangeHostName }
guest_capability("linux", "configure_networks") { Cap::ConfigureNetworks }
end
end
end

Vagrant.configure(2) do |config|
config.vm.define "barge-x-iso"

config.vm.box = "ailispaw/barge"

config.vm.provider :virtualbox do |vb|
vb.memory = 2048
end

config.vm.hostname = "barge-x-iso"

config.vm.synced_folder ".", "/vagrant", id: "vagrant"
end
Loading

0 comments on commit 802b717

Please sign in to comment.