Does Digital Ocean have a Docker image (or a Dockerfile to create one) that is exactly the same as the one in the Ubuntu 18.04 droplet?
I would like to “emulate” a Digital Ocean Ubuntu droplet in my Mac (iOS) locally. Does Digital Ocean have an image (or a Dockerfile to create one) that is exactly the same as the one in the droplet? That’s my question, if you need more details about it, there you have:
- Why I’m asking it? I would like to emulate on my Mac what is going on in the server (droplet). For ex, I would like to make mySQL to restart if the server reboots. I can’t reboot the droplet, so I want to test if my code works on my local version. (Actually, can I reboot the droplet to test if mySQL restarts?)
- What have I tried so far? I tried to create an Ubuntu image via Dockerfile (“FROM Ubuntu”), but when I install mysql-server on this image via Dockerfile (“sudo apt install -y mysql-server”) and I open the bash of this image (“exec”), mysql can’t be started (“fail” and “ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ’/var/run/mysqld/mysqld.sock’ (2)”). If I go inside the bash of the container, uninstall mysql and install manually, then I can run it. But to emulate what I want, I need that the image has mysql running automatically.
I know that Amazon has something similar (https://aws.amazon.com/amazon-linux-ami/), so I guess that maybe DO have its own too.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.