automate/020_podman.sh

76 lines
2.1 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# http://github.com/containers/libpod/blob/master/docs/tutorials/podman_tutorial.md
# Buildah and podman are redhats implementation of docker containers.
# Main configuration files:
# /etc/containers/registries.conf configuration file which specifies which container registries should be consulted when completing image names which do not include a registry or domain portion.
# /etc/containers/mounts.conf specify volume mount directories that are automatically mounted inside containers when executing the podman run or podman build commands
# Update system
sudo apt -y update && sudo apt -y upgrade
# Install pre-requisites
sudo apt -y install \
gcc \
make \
cmake \
git \
btrfs-progs \
golang-go \
go-md2man \
iptables \
libassuan-dev \
libc6-dev \
libdevmapper-dev \
libglib2.0-dev \
libgpgme-dev \
libgpg-error-dev \
libostree-dev \
libprotobuf-dev \
libprotobuf-c-dev \
libseccomp-dev \
libselinux1-dev \
libsystemd-dev \
pkg-config \
runc \
uidmap \
libapparmor-dev
# Install conmon
git clone http://github.com/containers/conmon
cd conmon
make
sudo make podman
sudo cp /usr/local/libexec/podman/conmon /usr/local/bin/
# Install CNI plugins
git clone http://github.com/containernetworking/plugins.git $GOPATH/src/github.com/containernetworking/plugins
cd $GOPATH/src/github.com/containernetworking/plugins
./build_linux.sh
sudo mkdir -p /usr/libexec/cni
sudo cp bin/* /usr/libexec/cni
# Setup CNI networking
sudo mkdir -p /etc/cni/net.d
curl -qsSL https://raw.githubusercontent.com/containers/libpod/master/cni/87-podman-bridge.conflist | sudo tee /etc/cni/net.d/99-loopback.conf
# Populate configuration files
sudo mkdir -p /etc/containers
sudo curl https://raw.githubusercontent.com/projectatomic/registries/master/registries.fedora -o /etc/containers/registries.conf
sudo curl https://raw.githubusercontent.com/containers/skopeo/master/default-policy.json -o /etc/containers/policy.json
# Install Podman
git clone http://github.com/containers/libpod/ $GOPATH/src/github.com/containers/libpod
cd $GOPATH/src/github.com/containers/libpod
make
sudo make install
podman version
podman info