jaimehrubiks
jaimehrubiks

Reputation: 110

Linux dev environment in osx (docker as mv or any other)

I'd love to hear from you some advice on setting up what I'm looking for.

I'm using OSX and I need to develop some code on a Linux machine, the thing is that I was looking for some VM alternative since it takes too much battery power.

The first thing I come across with was a docker container. I know It is not what it was designed for, but I thought it might work anyway. So I tried running a container as

docker run -i -t ubuntu /bin/bash

and it worked well. However all the changes I make are gone and I can't fins a way to solve it. I also tried

docker run -i -v /Users/JaimehRubiks/test:/home/Jaime -t ubuntu /bin/bash

and all files in there are saved (also very interesting because I can share my files with host), but it's kind of boring having to commit to the docker image if I change anything in the config files of my ubuntu.


What I'm looking for is just a simple way to run linux in my mac, and then access to it somehow, like I did in docker or via SSH.

Upvotes: 1

Views: 201

Answers (3)

Snorre
Snorre

Reputation: 333

Docker currently does not run natively on osx as Docker relies on the Linux kernel for its isolation features. In fact, the Docker Toolbox uses a Virtual Box virtual machine running the boot2docker Linux distro to run the Docker daemon on osx. See the official documentation on Mac osx installation.

The boot2docker linux image is quite light weight, but I'm not sure you will get much benefit from running Docker on osx for Linux development over simply running a full Virtualbox machine with Ubuntu (or other distro). If you want to run a virtual machine vagrant is a good tool to help you set that up. It lets you easily pull down images from an image repo, setup the image, and ssh into it. It also makes host -> guest-machine folder sharing and port forwarding quite simple.

Upvotes: 1

edwardramsey
edwardramsey

Reputation: 363

what about using vagrant to run Ubuntu or CentOS? you can access the system via command vagrant ssh and configure it with configuration file and share it like using docker.

Upvotes: 0

VonC
VonC

Reputation: 1323573

but it's kind of boring having to commit to the docker image if I change anything in the config files of my ubuntu.

You don't have to docker commit anything: any file change make on the host (/Users/JaimehRubiks/test) will be visible in the container (/home/Jaime)

Upvotes: 0

Related Questions