Docker Community Forums

Share and learn in the Docker community.

Can Docker avoid the package conflict problem?


(Cdhit) #1

Hi all,

I have conflict on the machine which has MariaDB and MySQL. I already have MariaDB, can’t install MySQL db.

Can I use Docker to avoid this case ?

To install MySQL in the Docker container to avoid the conflict?

I am a new guy on Docker. I have read some video tutorial online but still junior on Docker.
Can you please tell me if this works ?

Regards!

Dong


Hi I have to install Mysql as a metastore for the cloudera HUE.

But on that machine, it seems MariaDB is on that machine. I use yum to install

yum install mysql-community-server
I got this error.

Error: Package: MySQL-python-1.2.3-11.el7.x86_64 (@centos)
Requires: libmysqlclient.so.18(libmysqlclient_18)(64bit)
Removing: 1:mariadb-libs-5.5.44-2.el7.centos.x86_64 (@centos)
libmysqlclient.so.18(libmysqlclient_18)(64bit)
Obsoleted By: mysql-community-libs-5.7.12-1.el6.x86_64 (mysql57-commu nity)
Not found
Error: Package: MySQL-python-1.2.3-11.el7.x86_64 (@centos) Requires: libmysqlclient.so.18()(64bit) Removing: 1:mariadb-libs-5.5.44-2.el7.centos.x86_64 (@centos) libmysqlclient.so.18()(64bit) Obsoleted By: mysql-community-libs-5.7.12-1.el6.x86_64 (mysql57-commu nity) ~libmysqlclient.so.20()(64bit) You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest

BUt I can’t remove Mariadb-libs, because the Cloudera need it.

Somebody please give some suggestions.

Thanks.


(David Maze) #2

IMHO this is the thing Docker is really good at, with a light-weight sort-of-virtualization layer around it, and Docker use cases make more sense if you think of them as “I want to publish this application with these specific dependencies in a box” and less as something like a virtual machine.

The first short answer to your question is that, yes, you can just docker run -p 5433:5432 mysql and get a second database server up and running on a different port, avoiding host-system library conflicts.

You could envision working around this problem by creating a new directory (a “chroot” environment), separately installing a Linux distribution base into it, and then installing the new database there. Since it’s its own environment, you could install the separate service there with its own libraries, without conflicting with what’s on the host. But you don’t really need all of the other baggage that comes with a full Linux system: you don’t need an ssh daemon since you can just chroot(8) into the environment; you don’t need an init(8) since you’re only running one process, the database server; and you definitely don’t want the myriad other low-level system things systemd does because they’re already running on the system root.

Docker is like that, except that it includes a packaging and distribution format, it’s much harder to escape the chroot, and a couple of system resources like process IDs and networking are abstracted out.

The second short answer is that MySQL and MariaDB are extremely similar. MariaDB is, according to Wikipedia, maintained by one of the original MySQL maintainers, it is a fork of MySQL proper, and it’s not owned by a major commercial database vendor. Have you tried just pointing this system at your existing MariaDB database?


(Cdhit) #3

Thanks Dmaze, I haven’t notice that MariaDB is free version of MySQL. The most easiest way shall be the second.

But Docker seems much cooler. I haven’t tries the second solution. If I have to use docker as a fence to isolate the conflict,

  1. How much overhead expense will it take from the system?
    A new system running usually take 1G memory, is it?

  2. How can Docker deal with the complex network environment?
    Imagine in that complex network environment - a on-comprise environment, firewalls, iptables, whitelist on Http Proxy. How can Docker handle it? Is it complex and hard to figure out using Docker to handle them?

Regards!