Re:Asdf – the language tool version manager
by geraneum on Tuesday October 25, 2022 @02:35AM
(#33327002)
In reality, when using Docker, Dev and Prod are almost never the same. We usually install different packages in Dev image i.e. debuggers or linters, we try to optimize the heck out of the Prod image, thus using a different build of the base image, etc.
And all this, when you are only developing on Linux for Linux.
I’m not saying this is the right way but this is very common. I also agree with the rest of your points.
Re:Asdf – the language tool version manager
by pmontra on Tuesday October 25, 2022 @03:46AM
(#33327422)
Yes, I agree. I'm working on a Rails project today and the container in development has some gems we only use for development and testing: byebug, pry, rspec, timecop, simplecov, factory_bot. They won't go into the production images. The instructions for developers are
docker-compose build
docker-compose run --rm api bundle
docker-compose up
api is the name of the service in docker-compose.ymlOne developer has a M1 Mac and he's using something called mutagen instead of docker. His docker-compose.yml is a little different and he's paying a performance penalty. His M1 is only 50% faster than my Intel from 2014 at running the test suite (50 seconds vs 75.) The difference is not noticeable when running only a few tests per time when working on a single feature.
Re:Asdf – the language tool version manager
by oftenwrong on Tuesday October 25, 2022 @05:08AM
(#33328063)
You probably want to use
docker compose
not docker-compose
The latter was the name of the compose v1 binary, so using it may cause your command to be handled with a v1-to-v2 compatibility mode. Depends on how your installation is setup. Compose v2 is implemented as a Docker CLI plugin.
Re:Asdf – the language tool version manager
by kasbah on Tuesday October 25, 2022 @06:34AM
(#33328670)
When I invoke `docker compose up` on my project with Docker version 20.10.18 it says:
The new 'docker compose' command is currently experimental.
Re:Asdf – the language tool version manager
by oftenwrong on Tuesday October 25, 2022 @11:36AM
(#33332027)
I'm not sure what that means, but I don't think compose v2 is considered experimental at this point. It is included in Docker Desktop, for example. You might be running an older version. You can check `docker compose version`. Version 2.12.2 was released a few days ago.
- docker is good when the deployed software runs on docker too, because dev and prod are the same and on Linux the performance hit is negligible if any. If you're on Mac or Windows it seems that it can be felt.
- docker is a good way to distribute the development environment, anecdotally much better than Vagrant or bare VMs.
- However having to always prefix commands with docker exec container is a little pain. Working in docker exec container bash is worse.
- Sharing only volumes between the host file system and docker means that sometimes I have to copy files to the shared volume instead of addressing them where they are.
- asdf doesn't have all those problems but I must be careful to pick different ports for different postgresql servers in different projects. Docker would shield those ports inside the network of the project.
All considered, I use docker when a customer uses docker, VMs when a customer uses VMs, asdf for all the other cases including my own software which I never deployed to docker so far. If I did I'd probably work in docker because I don't want surprises at deployment time.