DEV Community


Running a project in podman (example)

fernand0 profile image Fernando Tricas García ・1 min read

As discused in my previous post So, you want to write your first container? I was not able to run Docker in my Fedora system.
Somebody recommended me to test podman. I installed it (sudo dnf install podman) read Transitioning from Docker to Podman and started changing my Dockerfile. Main changes are the image (fedora), the instructions for updating and installing needed software and it worked fine:

# our base image
FROM fedora

#RUN  sudo apt-key adv --keyserver --recv-keys <PUBKEY>
# Download latest listing of available packages:
RUN dnf update
# Upgrade already installed packages:
#RUN apt -y upgrade
# Install a new package:
RUN dnf install python python-pip
RUN dnf install libxml2 libxslt

# Install python and pip
#RUN apt -y install py-pip

# upgrade pip
RUN pip install --upgrade pip

## install Python modules needed by the Python app
#COPY requirements.txt /usr/src/app/
#RUN pip install --no-cache-dir -r /usr/src/app/requirements.txt

# copy files required for the app to run
COPY socialModules /usr/src/app/socialModules
RUN pip install --no-cache-dir -r /usr/src/app/socialModules/requirements.txt

# tell the port number the container should expose

# run the application
CMD ["/usr/bin/python", "/usr/src/app/socialModules/"]
Enter fullscreen mode Exit fullscreen mode

Discussion (0)

Editor guide