apocas / dockerode

Docker + Node = Dockerode (Node.js module for Docker's Remote API)
Apache License 2.0
4.37k stars 463 forks source link

Cannot use Dockerfile using scratch image #433

Closed guilherme-santos closed 6 years ago

guilherme-santos commented 6 years ago

When I tried to build a dockerfile that uses:

FROM scratch

I receive the message 'scratch' is a reserved name

apocas commented 6 years ago

https://github.com/moby/moby/issues/10737#issuecomment-74084238

guilherme-santos commented 6 years ago

@apocas I'm not pulling the image I'm building it. For example, to build following Dockerfile I'll get the same error...

FROM scratch
VOLUME /data
guilherme-santos commented 6 years ago

With this test case you can see that will fail:

it("should build image from scratch", function(done) {
      this.timeout(60000);

      function handler(err, stream) {
        expect(err).to.be.null;
        expect(stream).to.be.ok;

        stream.pipe(process.stdout, {
          end: true
        });

        stream.on('end', function() {
          done();
        });
      }

      docker.buildImage({
        context: __dirname,
        src: ['Dockerfile.scratch']
      }, {}, handler);
    });
apocas commented 6 years ago

Nothing we can do, Docker reserved that word :(

It's Docker that's sending that error to dockerode, dockerode is just displaying it to you.