forked from Bitmessage/buildbot-scripts
Refactor Dockerfile #1
|
@ -26,24 +26,6 @@ cores=$(grep -E '^cpu cores' /proc/cpuinfo |head -1|cut -d: -f2|tr -d '[:space:]
|
||||||
mem=$(sed -E 's/^MemTotal: +([0-9]+) kB/\1/p;d' < /proc/meminfo)
|
mem=$(sed -E 's/^MemTotal: +([0-9]+) kB/\1/p;d' < /proc/meminfo)
|
||||||
mempercore=$(((mem/1024-4096)/cores))
|
mempercore=$(((mem/1024-4096)/cores))
|
||||||
|
|
||||||
# install kata containers
|
|
||||||
if ! docker info 2>/dev/null|grep Runtimes:|grep -qs kata-qemu-virtiofs; then
|
|
||||||
echo "Installing kata...."
|
|
||||||
cid=$(docker run -d --runtime=runc -v /opt/kata:/opt/kata -v /var/run/dbus:/var/run/dbus -v /run/systemd:/run/systemd -v /etc/docker:/etc/docker -it katadocker/kata-deploy kata-deploy-docker install)
|
|
||||||
|
|
||||||
# wait for finish
|
|
||||||
while [ "$(docker container inspect -f '{{.State.Running}}' "$cid")" == "true" ]; do
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
|
|
||||||
# delete container
|
|
||||||
docker rm $cid
|
|
||||||
|
|
||||||
# update default container CPU and memory
|
|
||||||
sed -i "s/default_vcpus = .*/default_vcpus = 2/g;s/default_memory = .*/default-memory = $mempercore/g" /opt/kata/share/defaults/kata-containers/configuration-qemu-virtiofs.toml
|
|
||||||
echo "Kata installed"
|
|
||||||
fi
|
|
||||||
|
|
||||||
trusty
|
trusty
|
||||||
xenial
|
xenial
|
||||||
bionic
|
bionic
|
||||||
|
|
|
@ -69,6 +69,34 @@ RUN apt-get install -yq --no-install-suggests --no-install-recommends \
|
||||||
RUN apt-get install -yq --no-install-suggests --no-install-recommends \
|
RUN apt-get install -yq --no-install-suggests --no-install-recommends \
|
||||||
language-pack-en
|
language-pack-en
|
||||||
|
|
||||||
|
# Buildozer dependencies
|
||||||
|
RUN apt install -qq --yes --no-install-recommends \
|
||||||
|
autoconf \
|
||||||
|
automake \
|
||||||
|
build-essential \
|
||||||
|
ccache \
|
||||||
|
cmake \
|
||||||
|
gettext \
|
||||||
|
git \
|
||||||
|
libffi-dev \
|
||||||
|
libltdl-dev \
|
||||||
|
libssl-dev \
|
||||||
|
libtool \
|
||||||
|
openjdk-8-jdk \
|
||||||
|
patch \
|
||||||
|
pkg-config \
|
||||||
|
python2.7 \
|
||||||
|
python3-pip \
|
||||||
|
python3-venv \
|
||||||
|
python3-setuptools \
|
||||||
|
sudo \
|
||||||
|
unzip \
|
||||||
|
zip \
|
||||||
|
zlib1g-dev
|
||||||
|
|
||||||
|
RUN pip3 install "cython==0.28.6"
|
||||||
|
RUN pip3 install "buildozer==1.0"
|
||||||
|
|
||||||
# cleanup
|
# cleanup
|
||||||
RUN rm -rf /var/lib/apt/lists/*
|
RUN rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user