sudo apt install unzip curl git libmodule-build-perl libdbi-perl libdbd-mysql-perl build-essential zlib1g-dev
git clone https://github.com/Ensembl/ensembl-vep.git
cd ensembl-vep
./INSTALL.pl -a a
This will only build and install the base VEP and its dependencies. See the documentation (search for --AUTO
and --PLUGINS
) for the flags needed for additional content.
lxc-create -n vep -t download -- -d ubuntu -r bionic -a amd64
lxc-start -n vep
lxc-attach -n vep
sudo pacman -S lxc dnsmasq
sudo mkdir -p /etc/lxc
sudo sh -c 'echo "$USER:100000:65536" > /etc/subuid'
sudo sh -c 'echo "$USER:100000:65536" > /etc/subgid'
sudo sh -c 'echo "$USER veth lxcbr0 10" > /etc/lxc/lxc-usernet'
sudo sh -c 'cat > /etc/default/lxc-net <<EOF
USE_LXC_BRIDGE="true"
LXC_BRIDGE="lxcbr0"
LXC_ADDR="10.0.3.1"
LXC_NETMASK="255.255.255.0"
LXC_NETWORK="10.0.3.0/24"
LXC_DHCP_RANGE="10.0.3.2,10.0.3.254"
LXC_DHCP_MAX="253"
EOF'
sudo sh -c 'cat > /etc/lxc/default.conf <<EOF
lxc.net.0.type = veth
lxc.net.0.link = lxcbr0
lxc.net.0.flags = up
lxc.net.0.hwaddr = 00:16:3e:xx:xx:xx
lxc.idmap = u 0 100000 65536
lxc.idmap = g 0 100000 65536
EOF'
sudo sh -c 'echo "kernel.unprivileged_userns_clone=1" >> /etc/sysctl.d/userns.conf'
sudo sh -c 'echo "session optional pam_cgfs.so -c freezer,memory,name=systemd,unified" >> /etc/pam.d/system-login'
sudo systemctl enable lxc-net.service
mkdir -p ~/.config/lxc
cp /etc/lxc/default.conf ~/.config/lxc
mkdir -p ~/.local/share
setfacl -m u:100000:x ~ ~/.local ~/.local/share
sudo reboot now
The VEP installer unfortunately leaves a lot of garbage behind it. Fortunately, the multi-stage build feature of Docker addresses this well.
One can spawn a full Ubuntu 18.04 LTS Bionic Beaver image, with all the required dependencies, git, etc. to build VEP, then pick only the interesting bits from this image to put them into another clean image, possibly based on a leaner distro (eg. Alpine).
FROM ubuntu:18.04 as builder
WORKDIR /root/
RUN apt install unzip curl git libmodule-build-perl libdbi-perl libdbd-mysql-perl build-essential zlib1g-dev && \
git clone https://github.com/Ensembl/ensembl-vep.git && \
cd ensembl-vep && \
./INSTALL.pl -a a
FROM alpine:latest
MAINTAINER [email protected]
WORKDIR /root/
RUN apk --no-cache add ca-certificates
COPY --from=builder /root/ensembl-vep/vep .
CMD ["./vep"]
Note: there's much more than just vep
to copy to the lean image there. But you get the idea.
Note: LXC 3.0.2 is broken. If you get these errors:
… it is because of lxc/lxc#2556 , which has been fixed already, but not backported to ArchLinux.
Downgrading to LXC 3.0.1 may solve the problem until the fix is packaged: