0% found this document useful (0 votes)
252 views2 pages

Container in REDHAT

The document outlines the steps to build a container image named 'monitor' using a provided Containerfile and to configure a separate container named 'ascii2pdf' as a system start-up service. It details the necessary SSH commands for user access, the creation of local directories for persistent volume mounting, and the setup of systemd service for automatic container startup. Additionally, it includes commands for managing permissions and verifying the setup of the service.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
252 views2 pages

Container in REDHAT

The document outlines the steps to build a container image named 'monitor' using a provided Containerfile and to configure a separate container named 'ascii2pdf' as a system start-up service. It details the necessary SSH commands for user access, the creation of local directories for persistent volume mounting, and the setup of systemd service for automatic container startup. Additionally, it includes commands for managing permissions and verifying the setup of the service.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

13. Build a container as walhalla user.

a) Using the URL to build the container image with name monitor.
http://classroom.example.com/Containerfile
c) Do not modify the container file
######Note try to SSH with the User Don't Switch it from Root ########## USer
Password = The Same Password for the Root
$ ssh [email protected]
$ wget http://classroom.example.com/Containerfile
$ ls
$ Container-file
$ podman login ( You will find the Link in exam put it here then Enter)
$ username:- ( You will find in The Document not in the exam paper )
$ Password:- ( You will find in The Document not in the exam paper )
Login Successfully
$ podman build -t monitor -f Container-file
#########For Check#####################
$ podman images

14. Configure the container as a system start-up service and mount volumes
persistently
a) Create the container name as ascii2pdf as student user
b) Run the container by using image monitor which one was already done in previous
c) Create the container as a system start-up service, While reboot it will
automatically start the
service without any human intervention.
d) The system service should be container-ascii2pdf.
e) The local directory /opt/files should be persistently mount on container’s
/opt/incoming
directory.
f) The local directory /opt/processed should be persistently mount on
container’s /opt/outgoing
directory.
Note: In working of service starts, any file create/store under the /opt/files
automatically
creates into pdf on /opt/outgoing directory.

######### SSH With Root to create the Directories + chown -R + chmod 777
#############
$ ssh [email protected]
$ mkdir /opt/files
$ mkdir /opt/processed
$ chown -R walhalla:walhalla /opt/files
$ chown -R walhalla:walhalla /opt/processed
$ chmod 777 /opt/files
$ chmod 777 /opt/processed
######### For Check ########
$ ls -ld /opt/files
$ ls -ld /opt/processed
$ exit ###### end the SSH from Root and try new SSH with user DOnt Switch to User
from the same Shell ##########
$ ssh [email protected]
$ loginctl enable-linger walhalla
$ loginctl show-user walhalla | grep "Linger" ##### Should be yes
$ podman run -d --name ascii2pdf -v /opt/processed/:/opt/outgoing/:Z -v
/opt/files/:/opt/outgoing/:Z monitor
$ mkdir /home/walhalla/.config/systemd/user -p
$ cd /home/walhalla/.config/systemd/user
$ podman generate systemd --files --new --name ascii2pdf
$ ls
$ container-ascii2pdf.service
$ systemctl --user daemon-reload ### no error = You in the right way ###
$ systemctl –user enable --now container-ascii2pdf.service ### autocomplate
###
$ podman container rm logserver -f ##### the container will remove and the
service will create new one in notime #####

You might also like