Question

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?

Hi, 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. Thank you.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

jarland
DigitalOcean Employee
DigitalOcean Employee badge
January 8, 2019
Accepted Answer

Hey friend,

Great question! We don’t have one, but our images are basically just this: https://cloud-images.ubuntu.com/

That said, I’d like to focus more on the reasons for doing it, as I think there may be a better path.

Making MySQL start on boot should be just something like this:

systemctl enable mysql

That enables the service to start on boot. No need to test it, as it will work unless another circumstance exists that needs your manual intervention, such as a corrupted database. There’s really no good way to automate that specific scenario that doesn’t put you at greater risk.

Jarland

Thank you, you helped a lot!

Thank you, you helped a lot!

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel