I am on a Windows machine trying to create a Dart server. I had success building and image with my files with ADD
and running the container. However, it is painful to build an image every time I wan't to test my code so I thought it would be better to mount my files with the -v
command since they are access live from my host machine at runtime.
The problem is that dart's packages folder at /bin/packages
is really a symlink (if its called symlink in windows) and docker or boot2docker or whatever doesn't seem able to go past it and I get
Protocol error, errno = 71
I've used dart with GAE and the gcloud
command somehow created the container, got your files in there and reacted to changes in your host files. I don't know if they used the -v
option (as I am trying) or they have some auto-builder that created a new image with your files using ADD
and the ran it, in anycase that seemed to work.
More Info
I've been using this Dockerfile that I modified from google/dart
FROM google/dart
RUN ln -s /usr/lib/dart /usr/lib/dart/bin/dart-sdk
WORKDIR /app
# ADD pubspec.* /app/
# RUN pub get
# ADD . /app
# RUN pub get --offline
WORKDIR /app/bin
ENTRYPOINT dart
CMD server.dart
As you see, most of it is commented out because instead of ADD
I'd like to use -v
. However, you can notice that on this script they do pub get
twice, and that effectively creates the packages inside the container.
Using -v
it can't reach those packages because they are behind host symlinks. However, pub get
actually takes a while as it install the standard packages plus your added dependencies. It this the only way?