Live data from Hacker News

Docker as an Integrated Development Environment (2019)

medium.com

11–20 of 93 posts

Re: Docker as an Integrated Development Environment (2019)

#12
post #3

Can you run ansible or terraform inside a docker container? There are two parts of the dev environment - the programmer preferences and the project libraries and other infrastructure. What I would like is to have a way to compose those two and ideally something that would work the same way inside a docker container as in a full VM.

Nix and Guix are both answers to that combined need.

Re: Docker as an Integrated Development Environment (2019)

#13
Update: The original post is from January 2019.

Ashley Broadley's github page at https://github.com/ls12styler sadly doesn't contain a repo with his rust dev work to date (I will ask him as it has some really good stuff in the article.)

----

Very nice. I'm doing similar at the moment. Maybe take a look at

https://www.reddit.com/r/rust/comments/mifrjj/what_extra_dev...

A list of useful cargo built in and third party sub commands.

As you note, common recommended app crates (source) should be gathered separately.

I have several other links and ideas eg supporting different targets such as x86_64-linux-unknown-musl but too long for this post!

Re: Docker as an Integrated Development Environment (2019)

#15

I only get a new laptop once every several years. Doesn't really seem worth it to me personally. I also sort of like starting fresh in a way. Granted I have my dot-files on github to make that part easier. But I don't mind running the install command for things as they come up. I'm curious if there are other benefits to this approach though besides just saving time when setting up a new machine. The article mentioned…

I now go a bit further. I used to keep my dot files around as well but last time I decided to go completely fresh and I learned about powerline10k (more performant than powerline9k) and sdkman (an installer for multiple and different sdk flavours) and had a nice evening to boot. If I hadn’t started over I would just have used the old config and not enjoyed the new benefits.

Re: Docker as an Integrated Development Environment (2019)

#17
Nice, similar thing to what I do, a few more things:

1. If you want X11 (haven't figured out audio yet)

"-e DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix:ro"

2. Firefox

> --shm-size=2g

and start with: firefox --no-remote

3. Entering container

Just map a command to enter the container with the name as parameter / optional image type as second.

That way you get a new fresh environment whenever you want

Command would just start if it's not started or exec otherwise. I go extra length to have docker start up a ssh server inside container and I just ssh into it.

Re: Docker as an Integrated Development Environment (2019)

#18
Go the next step and run a local kubernetes cluster with kind or k3s (it will take you 30 seconds to have a k8s cluster going). IMHO the kubectl CLI is a lot more logical than docker's CLI. You can create all your local storage volumes ahead of time, create a pod that attaches to it, and then just kubectl exec into the pod vs. writing a long fiddly docker command line string (or crafting a docker-compose.yml). It's easy to adjust the pod as necessary while it runs too, like adding a service to expose ports without rerunning the container.

But if you do like the idea of docker dev environemnts, check out a tool like batect: https://github.com/batect/batect It's somewhat like if docker-compose had make-like commands you could define. Your whole dev environment and workflow can be defined in a simple yaml config that anyone can use.

Re: Docker as an Integrated Development Environment (2019)

#19

I only get a new laptop once every several years. Doesn't really seem worth it to me personally. I also sort of like starting fresh in a way. Granted I have my dot-files on github to make that part easier. But I don't mind running the install command for things as they come up. I'm curious if there are other benefits to this approach though besides just saving time when setting up a new machine. The article mentioned…

I think I share your line of thinking.

What are the benefits? Are there down sides to being operating in the docker container for everything?

Re: Docker as an Integrated Development Environment (2019)

#20
post #3

Can you run ansible or terraform inside a docker container? There are two parts of the dev environment - the programmer preferences and the project libraries and other infrastructure. What I would like is to have a way to compose those two and ideally something that would work the same way inside a docker container as in a full VM.

I have a co-worker who had the idea of stuffing Ansible into a container. This would allow anyone to easily run any Ansible playbooks without having to deal with dependencies and versions. It’s absolutely terrible to use. You end up having wrapper scripts to make it even remotely usable. Mounting things in the right locations is a nightmare, even minor changes becomes a hassel. For Ansible, just learn to use virtuale…

We do the same thing but I wouldn’t call it a nightmare /hassle. It’s exactly one helper script to start up the container with the right volumes and a few aliases to make commands (ansible / ansible-playbook / etc) work seamlessly. Some good tips here: https://jonathan.bergknoff.com/journal/run-more-stuff-in-doc...
Post reply on HN