Docker Community Forums

Share and learn in the Docker community.

Is there any way to create container CentOS 7 that work Sytemctl , Msyql, Apache, ssh, rsync?

I want to go from Openbox to work with Docker with test machine. In my laptop with windows destop.
I work with web developments, in virtual machines with Centos.
I need Apache, php7, mysql or mariadb, ssh, rsync, among other services to work,
I made several attempts but failed to make it work to systemctl or ssh or rsyncct support or issue reporting channel.

yum install httpd


…Installed:
… httpd.x86_64 0:2.4.6-89.el7.centos.1

…Dependency Installed:

systemctl restart httpd

Failed to get D-Bus connection: Operation not permitted

yum install openssh-server

… Installed:
… openssh-server.x86_64 0:7.4p1-16.el7

ssh www27

   bash: ssh: command not found

systemctl restart sshd

Failed to get D-Bus connection: Operation not permitted

Is there any way to create container with Centos that work the cited services (apache mysql php7 or mariadb ssh rsync etc ?

If you really need systemd, then I think you need to run in privileged mode. But I really think you need to rethink what you are doing. Running a bunch of services inside a single container is very un-docker like. The normal docker model would be to run each one in its own container, skip ssh completely (ssh into the host and docker exec into the container if you need access), and use a docker-compose file to link them all together.

If you really need them all in one container, I would suggest LXC or a virsh VM instead.

Sorry for my english google, and for answering. Thanks for your help. I currently use virtualbox to work on my notebook (vm - linux apache mysq ssh rsync) I use it as a development environment. I wanted to replace virtualbox with docker because I see that it consumes much less resources.