Docker Community Forums

Share and learn in the Docker community.

Cannot find out how to dockerize (a standard program from github )

After downloading ( https://github.com/strongloop/loopback-example-user-management ), installing, “npm install” (it is a Node.js application) only a few steps are required to get the program up and running:

In the file server/datasources.json you have to specify a mail server and a sender mail adress.
In the file server/config.json you have to specify a host and a port (The host must not contain 0.0.0.0, the current address must be present. It is used internally for preparing the confirmation link for the email verification).

That’s all. You can get the program running by e.g. with “node .”.
(I now suspect that the error is in the Dockerfile, but I’m already too exhausted to deal with it again.)

This is my Dockerfile:

FROM node:12.16-alpine AS build
ENV NODE_ENV production
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install --quiet
COPY . .
RUN mkdir /permstorage
VOLUME /permstorage
EXPOSE 3017
CMD [“node”, “server/server.js”]

I did it with:
docker build -t tracks_docker

With:
docker run tracks_docker

I get in the Chrome browser on Windows:
"This page is not working
127.0.0.1 has not sent any data.
ERR_EMTY_RESPONSE

Under ubuntu 18.04 I get
“Error: listen EADDRNOTAVAIL: address not available 167.86.117.241:3017”

And then the Dockerfile of my app, based on example-user-management, also not working:

FROM node:12.16-alpine AS build
ENV NODE_ENV production
COPY package*.json ./
RUN apk update && apk add --no-cache --virtual .gyp python make g++ &&
npm install --quiet node-gyp -g
RUN npm install --quiet
RUN pwd
WORKDIR /usr/src/app
COPY . /
RUN ls -la /
RUN pwd
RUN cd / && node-gyp clean && node-gyp configure && node-gyp build

FROM node:12.16-alpine
COPY --from=build . .
RUN mkdir /permstorage
VOLUME /permstorage
EXPOSE 3017
ENTRYPOINT [“node”]
CMD ["./server/server.js"]

Thanks in advance for your help
Gert

G508031@RMM-P7000032FW MINGW64 /
$ net start com.docker.service
The Docker for Windows Service service is starting.
The Docker for Windows Service service was started successfully.

G508031@RMM-P7000032FW MINGW64 /
$ docker version
Client:
Version: 17.12.0-ce
API version: 1.35
Go version: go1.9.2
Git commit: c97c6d6
Built: Wed Dec 27 20:05:22 2017
OS/Arch: windows/amd64
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.35/version: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.

G508031@RMM-P7000032FW MINGW64 /
$ net start com.docker.service
The requested service has already been started.