matreyes
Just wanted to share my experience:
I was suffering with my elixir vscode devcontainer (docker) environment, because tests took ~20 seconds to start running.
I tried delegating the workspace:
- ..:/workspace:delegated
This makes the shared folder (between the container and the host) to write first on the container and to be eventually consistent with the host, so it doesn’t try to sync all the time.
At the beginning it worked, but sometime at the beginning of this year (2021) slowed down again.
Finally got with this amazing post by Marcus Baguley, that recommends to change the /deps and /_build folder to somewhere outside the workspace folder:
https://stories.abletech.nz/optimising-docker-for-mac-and-elixir-130db4ecd7c3
And now it works as expected.
Totally recommended for your dev environment!
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #ai
- #elixirconf-us
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 7- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
egze
That’s cool. Thanks for sharing
cnck1387
Another benefit besides speed from moving your build deps out of your volume mount path is that you will no longer have a bunch of dependencies volume mounted back to your dev box, so things stay tidy.
It’s also a discussion point in my upcoming DockerCon talk because this concept applies to other things too like
node_modules/.quatermain
Did you try
.dockerignorefile where you can put folders to ignore and Docker will not use them for loading?Exadra37
Are you on a MAC?
matreyes
Yes! Docker on Mac doesn’t shine.
matreyes
Oh, I discovered that It was easier than what Marcus sugested
the env variables MIX_BUILD_ROOT and MIX_DEPS_PATH overrides build_path and deps_path, so you just have to add
to your docker-compose
user20230119
If you’re on Windows, compiling was slow using bind mounts with Dev Container. I copied my workspace to a named volume and it run as fast as it does on the host.