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

Become a contributor for community

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

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.