DockerHub and Dockerfile
Link DockerHub with local
- Sign up and in to Docker Hub.
- Create a Repo on the Docker Hub.
- Name it as zcemycl/ubuntu-nodejs, set to public. (free account)
- Log in Dockerhub connection by,
docker login
, then type your username zcemycl and password.
- Create a dockerfile named
Dockerfile
.
FROM busybox
CMD echo "Hello world! This is my first Docker image."
- Build Docker Image.
docker build -t zcemycl/ubuntu-nodejs .
- Test Docker Image.
docker run zcemycl/ubuntu-nodejs
- Push Docker Image to Docker Hub.
docker push zcemycl/ubuntu-nodejs
- You should now see the changes in dockerhub repo.
References