1

I started looking into docker lately and I understand a lot of the benefits it offers I think, you can quickly create a docker container and run it on different machines. Building (compiling) is also relatively easy, you can download the maven image for example and just build your code. That works fine. So, building is easy, testing is easy and deploying (and running) in production is easy.

What I don't understand is how docker can make the development phase easier. And what I mean with the development phase is, starting up your IDE, reading code, quickly navigate through your methods definition using the methods the IDE provides, use intelliSense, etc. Then change something, run a unit test, try a different third party library, etc. All things you can do with your IDE. But I don't understand how to do this with a docker image. I've read a few posts about starting the IDE from within your docker container, but that requires setting things up with a windows manager and I am not sure if that's the way to go.

Of course I can set up my laptop in such a way that I can do all of this with my IDE, but that way I bypass all of the benefits docker should offer. I still have to download dependencies, set up environment variables, do a lot of manual settings etc. And not just me, but everyone in the team.

So, not a very concrete question, possibly a duplicate, but I just can't wrap my head around it, how to use an IDE together with docker?

Willem
  • 35
  • 10
  • 1
    Most of the popular IDEs are licensed, Adding an IDE to be used by anyone you give your docker container will breach the agreement. – Abdul Rehman Jan 03 '18 at 13:23
  • My intention is not to ship the IDE. I just want to use it on my development laptop. – Willem Jan 03 '18 at 14:42
  • Very related: [Using an IDE while developing on a docker container](https://stackoverflow.com/questions/46724661/using-an-ide-while-developing-on-a-docker-container) – Duncan Jones Feb 09 '18 at 09:26
  • Possible duplicate of [Using an IDE while developing on a docker container](https://stackoverflow.com/questions/46724661/using-an-ide-while-developing-on-a-docker-container) – Mario Souza Feb 13 '18 at 10:20

1 Answers1

0

Yeah it's hard. It also depends on what language/framework you're using. But the things you mention are all easy to accomplish. For example we use Ruby a lot and someone in my team uses RubyMine to work with his code. That source code is mapped onto the container so the changes are reflected immediately. If you want to run a test, I'm sure you can override the command your IDE brings by default with something custom like docker run --rm myapp ./run_tests.sh or similar. At least that's what I do with VIM. Probably the most important missing part when doing dev with Docker is debugging. I think JetBrains is starting to add features to their IDE's but I'm not sure on the status of that.

Also, almost every IDE or good editor has an integrated console. You could maintain a docker exec sessions opened there and run all your app commands, like tests, generators or any other. Even do some basic debugging.

Hope it helps.

pacuna
  • 1,831
  • 16
  • 15