I really like containing the environment for a project in a docker container. I've been doing so with Alpine linux, but some projects, the kind that like to install binaries aren't always compatible or they're out of date(..where you can sometimes build your own, other times, it's not practical, using alpine:edge can be an option for some but I'm also not fond of that, it's kind of like imagename:latest, and I want a container to prevent the breakage when I revisit a project 6-12 months+ later).I'm getting the impression from those pain points that I should avoid Alpine as a development image, it's usually the development part where I'd have less problems, though Alpine in some cases doesn't seem always suitable as a production image either(alpine:edge is not reliable if required, or musl/musl-libc causing problems, working around those can bloat the size and/or not be fun to maintain) as much as I might prefer to use it.Another thing I've noticed was running my npm/yarn install commands should be done in the container which avoids conflicts that I think are only due to musl? Is it generally safe to use npm/yarn install on the host system out of the container if you're using the more common distros as base images which aren't using musl? With the alpine dev container I have, it's not practical to modify the package.json, as that'll update the lock file which appears to also empty node_modules and reinstall everything(at least as the cache isn't persisted it's fetching everything regardless, perhaps I could use a volume mount to keep a copy of the cache local?)TL;DR:Do you use Docker for development with projects at all? Or only for production/CI?Do you use Alpine Images or similar at all? If so do you use them for development as well or a different Image?Do you run npm/yarn to install/add packages outside or inside of the container(the commands, not actual storage of node_modules, which I would assume is volume mounted in most cases) when using Docker for development rather than production? If within the development container, do you volume mount you package manager cache?Any other tips/advice from those who have been using Docker for development use?(I'd like to hear from you too if you got burnt by it some other reason to avoid/ditch Docker for development or otherwise).
Submitted January 09, 2019 at 07:46AM by kwhali
No comments:
Post a Comment