Since the image does not exist, you will need to create it. This is done with a file called Dockerfile that has more or less this structure:
FROM ubuntu:14.04
EXPOSE 80
VOLUME /src
WORKDIR /src
RUN apt-get update
RUN apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
RUN apt-get install -y nodejs
RUN npm install -g forever
CMD forever -c node app.js
FROM is the name of the base image you will use. In this case I use the basic image of Ubuntu. EXPOSE indicates a port that this container will listen to (such as a firewall opening). VOLUME is used to share files between container and host machine.
In this case I create in the file structure of my container a directory /src that can be mounted later by the host. Works like Vmware shared folders, virtualbox.
WORKDIR is nothing more than a cd command that indicates that all commands executed by the container must have the /src path as the basis. RUN serves to make the container execute a command. In this case I install some packages.
Finally, CMD is a special type of RUN that serves to say what the purpose of the container is, that is, in this case my container is intended to run a Node application. It is also possible to use ENTRYPOINT for this, but it is more used to run services.
After setting Dockerfile, you need to go to the directory where it is (using cd) and run the Docker build command. This will turn your Dockerfile into a ready-to-run image with Docker run.
Since the image does not exist in the hub, you can send it there. For this you need to create an account in the hub and on your machine to run:
docker login
The command will ask for your hub login and password. Finally you use the command below to submit your image to the hub:
docker push seuusuario/suaimagem
With this, the next time you need this image, instead of having to create a Dockerfile and build it, you can simply do:
docker run seuusuario/suaimagem
Reference of the Dockerfile: https://docs.docker.com/engine/reference/builder/
Have you thought about using a Puppet image and installing this with Puppet in container creation?
– Giuliana Bezerra