Update and rename podman-install.sh to podman-v5-install.sh

This commit is contained in:
tteckster 2023-01-09 15:10:13 -05:00 committed by GitHub
parent d0e43fa657
commit 60e5cec0bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 35 deletions

View File

@ -19,7 +19,7 @@ set -o pipefail
shopt -s expand_aliases shopt -s expand_aliases
alias die='EXIT=$? LINE=$LINENO error_exit' alias die='EXIT=$? LINE=$LINENO error_exit'
trap die ERR trap die ERR
silent() { "$@" > /dev/null 2>&1; }
function error_exit() { function error_exit() {
trap - ERR trap - ERR
local reason="Unknown failure occurred." local reason="Unknown failure occurred."
@ -76,47 +76,21 @@ alias die='EXIT=$? LINE=$LINENO error_exit'
set -e set -e
msg_info "Updating Container OS" msg_info "Updating Container OS"
apt-get update &>/dev/null $STD apt-get update
apt-get -y upgrade &>/dev/null $STD apt-get -y upgrade
msg_ok "Updated Container OS" msg_ok "Updated Container OS"
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
apt-get install -y curl &>/dev/null $STD apt-get install -y curl
apt-get install -y sudo &>/dev/null $STD apt-get install -y sudo
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
msg_info "Installing Podman" msg_info "Installing Podman"
apt-get -y install podman &>/dev/null $STD apt-get -y install podman
systemctl enable --now podman.socket &>/dev/null $STD systemctl enable --now podman.socket
echo -e 'unqualified-search-registries=["docker.io"]' >> /etc/containers/registries.conf echo -e 'unqualified-search-registries=["docker.io"]' >> /etc/containers/registries.conf
msg_ok "Installed Podman" msg_ok "Installed Podman"
read -r -p "Would you like to add Portainer? <y/N> " prompt
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
PORTAINER="Y"
else
PORTAINER="N"
fi
if [[ $PORTAINER == "Y" ]]; then
msg_info "Installing Portainer"
podman run -d \
--name portainer \
--restart always \
-v /var/run/podman/podman.sock:/var/run/docker.sock \
-v portainer:/config \
-v /etc/localtime:/etc/localtime:ro \
-v /etc/timezone:/etc/timezone:ro \
-p 8000:8000 \
-p 9000:9000 \
portainer/portainer-ce:latest &>/dev/null
podman generate systemd \
--new --name portainer \
>/etc/systemd/system/portainer.service
systemctl enable portainer &>/dev/null
msg_ok "Installed Portainer"
fi
PASS=$(grep -w "root" /etc/shadow | cut -b6) PASS=$(grep -w "root" /etc/shadow | cut -b6)
if [[ $PASS != $ ]]; then if [[ $PASS != $ ]]; then
msg_info "Customizing Container" msg_info "Customizing Container"
@ -139,6 +113,6 @@ if [[ "${SSH_ROOT}" == "yes" ]]; then
fi fi
msg_info "Cleaning up" msg_info "Cleaning up"
apt-get autoremove >/dev/null $STD apt-get autoremove
apt-get autoclean >/dev/null $STD apt-get autoclean
msg_ok "Cleaned" msg_ok "Cleaned"