Docker image creation using nodejs with redis

Viewed 32

i am using below Docker file. how can i configure redis in my Dockerfile?

also i am using build command docker build - < Dockerfile but this didn't work out. if i run this command the following error will show

COPY failed: no source files were specified

FROM node:lts

RUN mkdir -p /app

WORKDIR /app

COPY package*.json /app

RUN yarn

COPY . /app

CMD ["yarn","run","start"]
1 Answers

One cannot use docker build - < Dockerfile to build an image that uses COPY instructions, because those instructions require those files to be present in the build context.

One must use docker build ., where . is the relative path to the build context.

Using docker build - < Dockerfile effectively means that the only thing in the build context is the Dockerfile. The files that one wants to copy into the docker image are not known to docker, because they are not included in the context.

Related