Deploying Springboot project to Podman container
• Get a VM with Podman
• Login to VM
• Run podman login /artifactory.global.standardchartered.com/artifactory/docker-release/
○ Enter BankID and Pwd
○ Login Succeeded
• To pull an image use podman pull reponame/imagename
• Reponame = artifactory.global.standardchartered.com/
• Podman pull artifactory.global.standardchartered.com/nginx:latest (this works)
• Without sudo it fails with error - processing tar file(potentially insufficient UIDs or GIDs available in user namespace
• sudo podman pull artifactory.global.standardchartered.com/nginx:latest - this work fine and image is now available locally
• To create a container from local image
○ Sudo podman create --name "somename" imageid
○ Creates a pod but doesn’t run
• To start a local container --> sudo podman start "container name"
• sudo podman run -d --name nginx-app -p 8080:80 -d artifactory.global.standardchartered.com/nginx:latest
curl localhost:8080 --> will help confirm if nginx is running
• Podman ps -a --> details of containers running
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
83ac8ec2c82b artifactory.global.standardchartered.com/nginx:latest nginx -g daemon o... 3 minutes ago Up 3 minutes ago 0.0.0.0:8080->80/tcp nginx-app
$ podman stop nginx-app
$ podman start nginx-app
To remove a stopped containers - podman rm nginx-app(container name)
Distroless" images contain only your application and its runtime dependencies. They do not contain package managers, shells or any other programs you would expect to find in a standard Linux distribution.
• From the docker file it can be seen that the docker file starts by defining a base image by using keyword "FROM". In our case, we will be using ubi image
• We are using MAINTAINER keyword to specific the details of the maintainer and their email address
• ADD keyword is used to add a fie from local machine/project directory (current directory) to the a path in the image. In our case we are placing a repo file "sample_file.repo" to /etc/yum.repos.d/ directory of the image
• RUN command can be used to run other bash commands in the image. In our case we are using yum to install rpms
• ENTRYPOINT defines the default command that will be running on the container.
• CMD keyword is used to add argument to the ENTRYPOINT command, in our case we are not having any arguments so it left commented
Comments
Post a Comment