Pages

Tuesday, May 3, 2022

Photon OS & Docker host installation

Start with minimal Photon OS installation

User/Group Management

useradd -m -G sudo admin

-m creates the home directory, while -G adds the user to the sudo group

usermod -aG docker admin

-aG adds the user to the additional group (docker)

passwd admin

Change user password.

chage -M 36500 root
chage -M 36500 admin
 
Change user password expiry information. It sets password expiration date to +100 years. More precisely it sets "Maximum number of days between password change" to 36500, which means never.
You can validate settings by command
chage -l admin

Set static IP address 

Official process is available here.
 
cd /etc/systemd/network/
 
# remove DHCP configuration
rm  99-dhcp-en.network
 
# configure Static IP configuration 
vi 10-static-en.network
 [Match]
Name=eth0
 
[Network]
Address=192.168.8.11/24
Gateway=192.168.8.254
DNS=192.168.4.5
 
chmod 644 10-static-en.network
 

Firewall

Allow ICMP

iptables --list
iptables -A INPUT -p ICMP -j ACCEPT
iptables -A OUTPUT -p ICMP -j ACCEPT
iptables-save > /etc/systemd/scripts/ip4save

Update OS

Update Operating System

sudo tdnf update

Configure Docker

Enable and start docker daemon

sudo systemctl enable docker
sudo systemctl start docker

Grant permissions to docker socket file

sudo chmod 666 /var/run/docker.sock

Docker-Compose Plugin

Follow instructions at https://docs.docker.com/compose/install/compose-plugin/#install-the-plugin-manually or at https://runnable.com/docker/introduction-to-docker-compose

Quick install ... be logged as admin user and run following commands

  • DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
  • mkdir -p $DOCKER_CONFIG/cli-plugins
  • curl -SL https://github.com/docker/compose/releases/download/v2.7.0/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
  • chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose

 


No comments:

Post a Comment