I am currently playing around with docker to create a PHP development environment. There are several containers (nginx, php7 + data container, mysql + data container, phpmyadmin) running and connected to each other, which is working fine so far. For convenience reasons, I am adding some scripts to the mysql container which can be used by the other developers to:
I provide a development server which pulls a live dump from production system every 15 minutes and places it in a well-known directory. Now I would like to add the second script to the mysql container, which basically does the following:
Use the SSH key of the developer (has been placed in an accessible folder before), connect to the development machine, get the SQL dump and replace the database with this content.
My current problem is that I have no idea how to get the data. I am using the mysql image as base image, inside the container there is no scp or similar available.
The question: How to realise the problem described above? Can I somehow install the scp command in the container? I don't want to rely on scripts running on the actual host because a variety of operating systems are used.
Add the following to your Dockerfile
:
RUN apt-get update && apt-get -y install openssh-client