Commit 421574e4 authored by Markus Frosch's avatar Markus Frosch 📣
Browse files

Split debootstrap to separate branch

parent ab63d388
Pipeline #3003 passed with stage
in 23 seconds
......@@ -19,11 +19,4 @@ build:
tags:
- docker-build-arm
script:
- make
- '[ "$CI_COMMIT_REF_NAME" != master ] || make -C debootstrap push'
- '[ "$CI_COMMIT_REF_NAME" != master ] || make push'
artifacts:
name: tarball
expire_in: 30d
paths:
- '*.tar*'
- make all push
FROM scratch
ADD rootfs.tar.xz /
CMD ["bash"]
FROM debian:stretch-slim
RUN apt-get update \
&& apt-get install -y debootstrap xz-utils tar \
&& rm -rf /var/lib/apt/lists/*
COPY debootstrap.sh /usr/local/sbin/
COPY script-raspbian /usr/share/debootstrap/scripts/raspbian
COPY qemu-arm-static /usr/bin/qemu-arm-static
CMD ["debootstrap.sh"]
REPO := raspbian-base
IMAGE_PREFIX := ${DOCKER_IMAGE_PREFIX}
ifeq ($(IMAGE_PREFIX),)
IMAGE_PREFIX := icinga/$(REPO)/
IMAGE_PREFIX := icinga/raspbian-base
endif
REGISTRY := ${DOCKER_REGISTRY}
......@@ -10,26 +8,23 @@ ifneq ($(REGISTRY),)
IMAGE_PREFIX := $(REGISTRY)/$(IMAGE_PREFIX)
endif
VERSION := stretch
IMAGE := $(IMAGE_PREFIX)$(VERSION)
.PHONY: all tarball clean
FROM := $(shell grep FROM Dockerfile | cut -d" " -f2)
IMAGE := $(IMAGE_PREFIX)debootstrap
all: build
.PHONY: all clean build
tarball: rootfs.tar.xz
all: pull build
rootfs.tar.xz:
$(MAKE) -C debootstrap build tarball
mv debootstrap/rootfs.tar.xz ./
pull:
docker pull "$(IMAGE)" || true
docker pull "$(FROM)"
build: tarball
docker build --tag "$(IMAGE)" .
build:
cp -av /usr/bin/qemu-arm-static .
docker build --cache-from "$(IMAGE)" --tag "$(IMAGE)" .
push:
docker push "$(IMAGE)"
clean:
$(MAKE) -C debootstrap clean
rm -f *.tar*
if (docker inspect --type image "$(IMAGE)" >/dev/null 2>&1); then docker rmi "$(IMAGE)"; fi
FROM debian:stretch-slim
RUN apt-get update \
&& apt-get install -y debootstrap xz-utils tar \
&& rm -rf /var/lib/apt/lists/*
COPY debootstrap.sh /usr/local/sbin/
COPY script-raspbian /usr/share/debootstrap/scripts/raspbian
COPY qemu-arm-static /usr/bin/qemu-arm-static
CMD ["debootstrap.sh"]
REPO := raspbian-base
IMAGE_PREFIX := ${DOCKER_IMAGE_PREFIX}
ifeq ($(IMAGE_PREFIX),)
IMAGE_PREFIX := icinga/$(REPO)/
endif
REGISTRY := ${DOCKER_REGISTRY}
ifneq ($(REGISTRY),)
IMAGE_PREFIX := $(REGISTRY)/$(IMAGE_PREFIX)
endif
FROM := $(shell grep FROM Dockerfile | cut -d" " -f2)
VERSION := debootstrap
IMAGE := $(IMAGE_PREFIX)$(VERSION)
.PHONY: all clean build tarball
all: pull build tarball
pull:
docker pull "$(IMAGE)" || true
docker pull "$(FROM)"
build:
cp -av /usr/bin/qemu-arm-static .
docker build --cache-from "$(IMAGE)" --tag "$(IMAGE)" .
tarball: rootfs.tar.xz
rootfs.tar.xz:
TARBALL="$@.tmp" ./make-image.sh
mv "$@.tmp" "$@"
push:
docker push "$(IMAGE)"
clean:
rm -f *.tar*
if (docker inspect --type image "$(IMAGE)" >/dev/null 2>&1); then docker rmi "$(IMAGE)"; fi
#!/bin/sh
if [ -n "$DOCKER_IMAGE_PREFIX" ]; then
IMAGE="${DOCKER_IMAGE_PREFIX}debootstrap"
else
IMAGE=icinga/raspbian-base/debootstrap
fi
if [ -n "$DOCKER_REGISTRY" ]; then
IMAGE="${DOCKER_REGISTRY}/${IMAGE}"
fi
opts=
if [ -t 1 ] && [ -t 0 ]; then
opts=-t
fi
docker run -i $opts --rm \
--privileged \
-e "TARBALL=$TARBALL" \
-v "$(pwd):/work" -w "/work" \
"$IMAGE" "$@"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment