0

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?

Cristian Garcia
  • 9,630
  • 6
  • 54
  • 75

1 Answers1

2

As far as I know you need to add the Windows folder as shared folder to VirtualBox to be able to mount it using -v using boot2docker.

gcloud doesn't use -v, it uses these Dockerfiles https://github.com/dart-lang/dart_docker.
See also https://www.dartlang.org/server/google-cloud-platform/app-engine/setup.html, https://www.dartlang.org/server/google-cloud-platform/app-engine/run.html
gclould monitors the source directory for changes and rebuilds the image.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567