Need help building the container! Please help!

Hello everyone. I ran into a problem when installing the package in the Linux operating system - after installing the necessary repositories and installing the package, I got a conclusion in the terminal that there are problems with dependencies:
Depends: python (< 2.8) but it is not installable
Depends: python (>= 2.7) but it is not installable
Depends: python:any (>= 2.6.6-7~) but it is not installable
Depends: python-configobj but it is not installable
Depends: python-gi but it is not installable
Depends: python-urlgrabber but it is not installable

I started studying Docker and container building
but I couldn’t solve this problem, build a container with these dependencies. If someone can help me with this problem, build an image from scratch or use a ready-made image, I would be very grateful. Thank you in advance for the answer!

Since everything can be found in the documentation and a huge amount of online tutorials available, you will need to share more details about your exact issue and what you already tried. And please, edit your post and choose a more specific title. “Please help” will not catch anyone’s eyes since everyone is here for asking help. Thank you!

When you share error messages, please, follow the the below guide to format your post:

Python2 is EOL, that’s why you won’t find it as package in most of the distros. You would need to figure out by yourself if any distro still supports Python2.

It is generally not adviced to use a random outdated image from Docker Hub, as it will high likely have critical and high vulnerabilities.

Migrate your code to Python3, or if it’s a python package from someone else, use their Python3 version. If non exists, look for an alternative package/solution.

Good afternoon. Thanks for the answer. The fact is that the package that I want to install has dependencies on these specific versions of Python and libraries. This is all outdated, but I looked through a bunch of repositories and the package I need is nowhere to be found! That’s why I decided to study Docker and build a container with these dependencies. Do you think that this package may be in other repositories in an updated form that does not have dependencies?

I can’t help you with raising the dead.

Docker would have been created just for this, or rather for this too! Give me some advice, what would you do if you needed to install a specific package on the system? Would you look for it in newer repositories, or would you look for an analogue?

I feel like I already made my recommendation:

Seems like you ignored my request completeley, so you get the guessing I predicted. If you really want help, you really need to work for it first.

Based on what you wrote, which doesn’t share what package you want to install, all I can say is use a Python 2 base image:

docker pull python:2

That image is mentioned in the image description as well: https://hub.docker.com/_/python

If the packages are not available even in those images, and the packages were for exaample removed from https://pypi.org/, there is nothing we can do and you should find the sourcecode and install manually for example.

Sorry, I got another reply and got distracted. I think I’ll delete this post and make a new one! The fact is that there are ready-made images on Docker Hub and I have already tried to install them, they install and work, but my application is not installed on the host, the output is the same, dependencies. Apparently you need to assemble the image yourself, but I still can’t imagine how to make it so that they are all in one container and so that when installing the package, the host sees this container that everything is installed there…

Alright, let’s forget it. :slight_smile:

I think you can’t delete a post which would delete the category when there are multiple replies in the topic already. It isn’t recommended either, since deleting the topic would delete all the replies on which people have spent time. You could still ask us to delete it, but it would be better to add more details.

For example share a Dockerfile or compose file, or commands. Whatever you used to build your image.

I’m confused. Should that be installed on the host or in the ontainer ?

The host will not see the container. I mean it could, depending on the host OS, but the container is an isolated system. Applications on the host will not be able to use applications in the container, the same way as apps in the container will not be able to use apps on the host, except if by “using” we mean communication over the network.

Again, until you share what exactly you are trying to do, we can’t help more.

(when I understand what you are trying to do, I will rename the topic)

I guess I misunderstood how docker containers work. I thought that a package would be installed on the host, which is not configured due to the Python versions and libraries selected for it, I would build a container with the desired Python region and libraries and run it, the application would see the docker process with all these dependencies and using them it is installed on the host. Do I understand correctly or is it not, and you need to build a container and save the application in it?

We always say that “a container is not a virtual machine”. That is absolutely true. With that in mind you can still think of it as a virtual machine in the sense that it is an isolated system and you can run an app in the container, but the app will “think” that is the only app on the entire host as it doesn’t see anything outside. The host can still see the processes running in a container (unless its Docker Desktop which runs everything in an actual virtual machine), but that won’t help. Those processes are independent. All you could do is send signals using the “kill” command, but you will not have permision to read its filesystem.

You could learn about containers from this tutorial: Introduction to Containers
or you could also read mine which shows some examples rather then explaining the theory.
https://learn-docker.it-sziget.hu/en/latest/

There are some ways to use a python app that actually runs in a container which involves using bind mounts (shared folders with the container), proper permission settings and some shell scripts so you can run a script that starts a container and can save or read files and can also write to the standard output so it could be read even from an IDE. Tht’s how I run unit tests in a PHP container and still start it from a JetBrains IDE (PHPStorm). For that you need to know much more about containers, but it won’t help if you want the apps on the host to axtually see that python2 is installed on the host . So yes, you need to install everything in the container.

Npw back to the fact that “containers are not virtual machines”, so you usually run a single process in the container which has to run in the foreground keeping the container alive. Otherwise it stops immediately. So let’s say you have a python app and other related services that has to run in the same environment. That is much more complicated in containers so I intentionally don’t start to explain it as I’m still not sure what you need. Normally you would run as many containers as the number of applications (processes) you need to run and let them communicate over the network or use shared folders.

That is, if in my situation I need to install a package from a repository on the host, and the installation requires certain versions of Python and outdated libraries, I will not be able to solve this using Docker, since I will have to install this package in the container itself, and not on host? If this is so, then I see two options: either I build a container not with Python2.7 and libraries, but the operating system itself, whose repositories I use, update it, download my package and use it in the container, or I will have to look for others repositories, newer ones, where there is the same updated package, I add them to the host, download from them the package that I am looking for and use it on the host and then I will not need the container. Am I thinking right? or have I missed something again?))

yes

I don’t understand why this is an option. Why would you buuld anything on the host and copy it into a container when your issue is that you want to run the app on the host? If you can run it in the container, then build an image based on the preferred Python version.

If by “newer repositories” you mean repositories in which you find the app’s newer version that you want to use, but requiring Python 3 insteadof Python 2, yes.

The thing is that I need the package on the host, since it is part of one large program, but I do not have it installed because it depends on an older version of Python. Depending on what I need only to download and install the package, then it will serve my program on the host. Probably the option with a container is not winning, which means I need to look for a newer version of the same package and install it on the host. Now I would like to find out in which repositories it is available. Thank you for your help and your time🙏

As the documentation and numerous online tutorials cover a wide range of topics, it would be beneficial if you could provide additional specifics about your issue and the steps you’ve already taken to address it. Additionally, consider editing your post to select a more specific title. A title like “Please help” may not grab the attention of potential responders, as many users here seek assistance. Thank you for your cooperation!