FreeKB - build image
Docker - build image

This assumes you have installed Docker on LinuxDocker is running, and that you have initialized swarm. Let's say you have an application named "foo" built to run on docker at /tmp/foo on your Linux server running Docker. This assumes that the foo application contains Dockerfile, like this.



And Dockerfile might contain markup like this.

FROM node:6.11.5

WORKDIR /usr/src/foo
COPY foo.json .
RUN npm install
COPY . .

CMD [ "npm", "start" ]


Move into the directory that contains the app.

cd /tmp/foo


The docker image build command is used to create an image for the application.

docker image build -t foo:1.0 .


If all goes well, something like this should be displayed.

Successfully built 84c9fb889b5a


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter e05bb in the box below so that we can be sure you are a human.