Split basic package builder from kernel builder

master
gdm85 9 years ago
parent ed48df5a4e
commit 7c1075116f

@ -1,26 +0,0 @@
#!/bin/bash
BASENAME=$(dirname $(readlink -m $0))
cd $BASENAME/../trusty-kbuilder || exit $?
if [ ! -f authorized_keys ]; then
echo "No authorized_keys file found in $PWD"
if [ -f ~/.ssh/id_rsa.pub ]; then
echo -n "Do you want to use ~/.ssh/id_rsa.pub? (y/n) "
read -r ANSWER
if [[ "$ANSWER" == "y" ]]; then
cp -v ~/.ssh/id_rsa.pub authorized_keys || exit $?
else
exit 1
fi
else
exit 1
fi
fi
##NOTE: can leave behind a running container of gitian-host
docker build --tag=gdm85/trusty-kbuilder . && \
echo "Ubuntu Trusty kernel builder image created successfully!" && \
echo "You can now spawn containers with:" && \
echo "docker run -d gdm85/trusty-kbuilder"

@ -1,48 +1,7 @@
## trusty-kbuilder
##
## VERSION 0.1.0
##
## Trusty image to build kernel
##
#
FROM trusty-pkgbuilder
## NOTE: this image must be debootstrapped with build-trusty.sh
FROM gdm85/trusty
MAINTAINER Giuseppe Mazzotta "gdm85@users.noreply.github.com"
ENV DEBIAN_FRONTEND noninteractive
## replace sources
ADD sources.list /etc/apt/sources.list
RUN apt-get update && apt-get install -y apt-utils aptitude && aptitude update && aptitude safe-upgrade -y && \
aptitude install -y nano tmux fakeroot build-essential crash kexec-tools makedumpfile kernel-wedge openssh-server
## log rotation is managed outside, thus remove it
## install necessary daemons
RUN apt-get remove -y logrotate
## set current user's id_rsa as only allowed key
ADD authorized_keys /root/.ssh/authorized_keys
RUN chmod -R go-rwx /root/.ssh
## disable password logins & reverse DNS lookups
RUN sed -i 's/^#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config && echo 'UseDNS no' >> /etc/ssh/sshd_config
EXPOSE 22
##NOTE: this will use current kernel version!
RUN apt-get build-dep -y --no-install-recommends linux-image-$(uname -r)
RUN apt-get install -y git-core libncurses5 libncurses5-dev libelf-dev asciidoc binutils-dev
## user that will make the compilation
RUN useradd -m -s /bin/bash rdeckard
RUN apt-get build-dep -y --no-install-recommends linux-image-$(uname -r) && \
apt-get install -y git-core libncurses5 libncurses5-dev libelf-dev asciidoc binutils-dev ## specific for kernel building
## add script for getting source
ADD build-kernel.sh /home/rdeckard/
ADD patches/ /home/rdeckard/patches/
RUN chown -R rdeckard.rdeckard /home/rdeckard
CMD /usr/sbin/sshd -D -e
COPY build-kernel.sh /home/rdeckard/

@ -4,7 +4,7 @@ set -e
apt-get source linux-image-$(uname -r)
cd linux-3.13.0
cd linux-*
## will fail here if no patches are available
## why are you recompiling kernel if no custom patches are there?

@ -0,0 +1,26 @@
## trusty-pkgbuilder
##
## VERSION 0.1.0
##
## Trusty image to build kernel
##
#
## NOTE: this image must be debootstrapped with build-trusty.sh
FROM gdm85/trusty
MAINTAINER Giuseppe Mazzotta "gdm85@users.noreply.github.com"
ENV DEBIAN_FRONTEND noninteractive
## replace sources
COPY sources.list /etc/apt/sources.list
RUN apt-get update && apt-get install -y apt-utils aptitude && aptitude update && aptitude safe-upgrade -y && \
aptitude install -y nano tmux fakeroot build-essential crash kexec-tools makedumpfile kernel-wedge
## log rotation is not managed in this container, thus remove it
RUN apt-get remove -y logrotate
## user that will make the compilation
RUN useradd -m -s /bin/bash rdeckard && mkdir /home/rdeckard/patches && chown rdeckard.rdeckard /home/rdeckard/patches
Loading…
Cancel
Save