4 ms·
I use LXC containers as my development environments. When I changed my setup from expensive Mac Books to an expensive work station with a cheap laptop as front
by melenaboija 5y ago
I use LXC containers as my development environments.
When I changed my setup from expensive Mac Books to an expensive work station with a cheap laptop as front end to work remotely this was the best configuration I found.
It took me few hours to have everything running but I love it now. New project is creating a new container add a rule to iptables and I have it ready in few seconds.
- dijit 5y agoFWIW I do the same thing but with docker. Exposing the docker daemon on the network and setting DOCKER_HOST I’m able to use the remote machine as if it was local. It’s hugely beneficial, I’ve considered making mini buildfarms that load balance this connection in a deterministic way.
- fideloper 5y agoHow do you share code files (set volume mounts) with remote docker via setup?
- botdan 5y agoDo you have any more information about how you're doing this? Whenever I've tried to use Docker as a remote development environment the process felt very foreign and convoluted.
- dijit 5y agoI know what you mean, It depends a little bit on your topology. If you have a secure network then it’s perfectly fine to expose the docker port on the network in plaintext without authentication. Otherwise you can use Port forwarding over SSH. To set up networked docker you can follow this: https://docs.docker.com/engine/security/protect-access/ https://docs.docker.com/engine/security/protect-access/ I’m on the phone so can’t give a detailed guide.
- markkrj 5y agoOr you can use a docker as a ssh host using context, or just $DOCKER_HOST=ssh://myremote... See https://stackoverflow.com/questions/44056501/how-can-i-remotely-connect-to-docker-swarm/68303222#68303222 https://stackoverflow.com/questions/44056501/how-can-i-remot...
- stickyricky 5y agoIs there a benefit to this over SSH or VSCode remote?
- zelphirkalt 5y agoNeither SSH not VSCode offer any kind of isolation out of the box.
- stickyricky 5y agoI mean running docker on the remote machine and just sshing into it. I assume changing the docker host on OSX just means a command is being sent over the network. Just wondering why prioritize "local" development if its all remote anyway.
- zelphirkalt 5y agoSetting up SSH inside a container and being able to SSH into the container wasn't so trivial to do, last time I read about it. If I recall correctly, there were also some host system security implications. What do you mean by 'prioritize "local" development'?
- stickyricky 5y ago"Machine A" SSHes into "Machine B". "Machine B" is running Docker. You run docker commands on "Machine B". The output of the command is returned to "Machine A". I.e. a normal ssh session. At no point do you ssh into a container.
- cpuguy83 5y agoHopefully you are doing this securely :) BTW, no need to expose DOCKER_HOST, you can connect to docker over ssh, e.g. `DOCKER_HOST=ssh://1.2.3.4`.