mirror of
https://github.com/jessfraz/dockerfiles.git
synced 2025-12-10 15:02:41 +01:00
4
coreos/.gitignore
vendored
4
coreos/.gitignore
vendored
@@ -1,4 +0,0 @@
|
|||||||
coreos_production_*.iso
|
|
||||||
coreos_production_*.bin
|
|
||||||
coreos_production_*.bin*
|
|
||||||
version.txt
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
# coreos base container
|
|
||||||
#
|
|
||||||
# docker run --rm -it \
|
|
||||||
# --cap-add SYS_ADMIN \
|
|
||||||
# --security-opt seccomp:/path/to/systemd-seccomp.json \
|
|
||||||
# --tmpfs /run:rw --tmpfs /tmp:rw \
|
|
||||||
# -e "container=coreos-rootfs" \
|
|
||||||
# -v /sys/fs/cgroup:/sys/fs/cgroup:ro \
|
|
||||||
# jess/coreos
|
|
||||||
FROM scratch
|
|
||||||
|
|
||||||
ENV container=docker
|
|
||||||
|
|
||||||
#ADD coreos-766.5.0.tar.xz /
|
|
||||||
COPY ./certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
|
||||||
|
|
||||||
RUN ( \
|
|
||||||
cd /lib/systemd/system/sysinit.target.wants/; \
|
|
||||||
for i in *; do \
|
|
||||||
if [ "$i" != "systemd-tmpfiles-setup.service" ]; then \
|
|
||||||
rm -f $i; \
|
|
||||||
fi \
|
|
||||||
done \
|
|
||||||
) \
|
|
||||||
&& rm -f /lib/systemd/system/multi-user.target.wants/* \
|
|
||||||
&& rm -f /etc/systemd/system/*.wants/* \
|
|
||||||
&& rm -f /lib/systemd/system/local-fs.target.wants/* \
|
|
||||||
&& rm -f /lib/systemd/system/sockets.target.wants/*udev* \
|
|
||||||
&& rm -f /lib/systemd/system/sockets.target.wants/*initctl* \
|
|
||||||
&& rm -f /lib/systemd/system/anaconda.target.wants/* \
|
|
||||||
&& rm -f /lib/systemd/system/basic.target.wants/* \
|
|
||||||
&& rm -f /lib/systemd/system/graphical.target.wants/* \
|
|
||||||
&& ln -vf /lib/systemd/system/multi-user.target /lib/systemd/system/default.target
|
|
||||||
|
|
||||||
# systemd needs a different stop signal
|
|
||||||
STOPSIGNAL SIGRTMIN+3
|
|
||||||
|
|
||||||
CMD ["/sbin/init"]
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
FROM debian:jessie
|
|
||||||
|
|
||||||
ENV HOME /home/user
|
|
||||||
RUN useradd --create-home --shell /bin/bash --home-dir $HOME user
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y \
|
|
||||||
bzip2 \
|
|
||||||
ca-certificates \
|
|
||||||
curl \
|
|
||||||
git \
|
|
||||||
gnupg \
|
|
||||||
python \
|
|
||||||
sudo \
|
|
||||||
tar \
|
|
||||||
xz-utils \
|
|
||||||
--no-install-recommends \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
COPY version.txt /home/user/
|
|
||||||
|
|
||||||
RUN git config --global user.email "no-reply@coreos.com" \
|
|
||||||
&& git config --global user.name "CoreOS Build SDK" \
|
|
||||||
&& curl -sSL https://storage.googleapis.com/git-repo-downloads/repo -o /usr/local/bin/repo \
|
|
||||||
&& chmod a+x /usr/local/bin/repo \
|
|
||||||
&& mkdir -p $HOME/coreos \
|
|
||||||
&& ( \
|
|
||||||
cd $HOME/coreos \
|
|
||||||
&& repo init -u https://github.com/coreos/manifest.git \
|
|
||||||
&& repo sync \
|
|
||||||
) \
|
|
||||||
&& adduser user sudo \
|
|
||||||
&& passwd -d user \
|
|
||||||
&& ln -snvf /dev/true /sbin/modprobe \
|
|
||||||
&& echo "sudo rootfs.sh" > $HOME/.bash_history \
|
|
||||||
&& chown -R user:user $HOME
|
|
||||||
|
|
||||||
COPY rootfs.sh /usr/local/bin/
|
|
||||||
|
|
||||||
WORKDIR $HOME
|
|
||||||
USER user
|
|
||||||
|
|
||||||
CMD ["bash"]
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
.PHONY: build_rootfs_image rootfs clean
|
|
||||||
|
|
||||||
BASE := http://stable.release.core-os.net/amd64-usr/current
|
|
||||||
|
|
||||||
COREOS_IMAGE := coreos_production_image.bin.bz2
|
|
||||||
DECOMPRESSED_COREOS_IMAGE := $(COREOS_IMAGE:.bz2=)
|
|
||||||
|
|
||||||
VERSION_FILE := version.txt
|
|
||||||
|
|
||||||
DOCKER_BUILD_ROOTFS_IMAGE := coreos:build
|
|
||||||
|
|
||||||
all: rootfs
|
|
||||||
|
|
||||||
$(COREOS_IMAGE):
|
|
||||||
@gpget -O -b -url "$(BASE)/$(COREOS_IMAGE)"
|
|
||||||
|
|
||||||
$(DECOMPRESSED_COREOS_IMAGE): $(COREOS_IMAGE)
|
|
||||||
@bzip2 -d "$(COREOS_IMAGE)"
|
|
||||||
|
|
||||||
$(VERSION_FILE):
|
|
||||||
@gpget -O -b -url "$(BASE)/$(VERSION_FILE)"
|
|
||||||
|
|
||||||
build_rootfs_image: $(VERSION_FILE)
|
|
||||||
@docker build --rm --force-rm -f Dockerfile.build -t $(DOCKER_BUILD_ROOTFS_IMAGE) .
|
|
||||||
|
|
||||||
rootfs: build_rootfs_image
|
|
||||||
@sudo modprobe fuse
|
|
||||||
@docker run --rm -it --privileged -v $(CURDIR):/images $(DOCKER_BUILD_ROOTFS_IMAGE) bash
|
|
||||||
|
|
||||||
clean:
|
|
||||||
$(RM) $(COREOS_IMAGE) $(DECOMPRESSED_COREOS_IMAGE) $(VERSION_FILE)
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,22 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
CERT_IMAGE="debian:latest"
|
|
||||||
|
|
||||||
# cd to the current directory so the script can be run from anywhere.
|
|
||||||
cd `dirname $0`
|
|
||||||
|
|
||||||
# Update the cert image.
|
|
||||||
docker pull $CERT_IMAGE
|
|
||||||
|
|
||||||
# Fetch the latest certificates.
|
|
||||||
ID=$(docker run -d $CERT_IMAGE bash -c "apt-get update && apt-get install -y --no-install-recommends ca-certificates")
|
|
||||||
docker logs -f $ID
|
|
||||||
docker wait $ID
|
|
||||||
|
|
||||||
# Update the local certificates.
|
|
||||||
docker cp $ID:/etc/ssl/certs/ca-certificates.crt .
|
|
||||||
|
|
||||||
# Cleanup.
|
|
||||||
docker rm -f $ID
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
source /home/user/version.txt
|
|
||||||
|
|
||||||
for i in {0..7}; do
|
|
||||||
if [[ ! -e /dev/loop$i ]]; then
|
|
||||||
sudo /bin/mknod -m640 /dev/loop$i b 7 $i
|
|
||||||
sudo /bin/chown root:disk /dev/loop$i
|
|
||||||
else
|
|
||||||
echo "/dev/loop$i exists"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
(
|
|
||||||
cd /home/user/coreos
|
|
||||||
./chromite/bin/cros_sdk
|
|
||||||
exit
|
|
||||||
./chromite/bin/cros_sdk --enter
|
|
||||||
./set_shared_user_password.sh
|
|
||||||
./setup_board --default --board=amd64-usr
|
|
||||||
./build_packages
|
|
||||||
./build_image --base_dev_pkg coreos-base/coreos container
|
|
||||||
)
|
|
||||||
|
|
||||||
#XZ_OPT=-9 tar cvJf "/images/coreos-${COREOS_VERSION}.tar.xz" .
|
|
||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user