how upload images to docker hub

 



First we go create account in docker-hub, when we have a account, login with this account in the computer

Terminal:
sudo docker login --username=your_user_name


create the repository

https://hub.docker.com/repository/create


please use the name: ubuntu-ssh to this tutorial or change for name the you project/image


create folder to project

Terminal:
mkdir -p ubuntu-ssh && cd ubuntu-ssh


add file to build image

Terminal:
touch Dockerfile


open file with your editor favorite, i use vim :)

Terminal:
vim Dockerfile


add this content

Terminal:
FROM ubuntu:18.04


# disable interactive functions
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN apt-get install ssh -y


CMD ["bash"]

if you use vim, to save and exit press : and write wq and press ENTER


build the image local

Terminal:
sudo docker build . -t ubuntu-ssh



list images

Terminal:
sudo docker images



we copy the IMAGE ID


we create a tag of image

Terminal:
sudo docker tag e53082e90e87 your_user_name/ubuntu-ssh:latest


we push the image

Terminal:
sudo docker push your_user_name/ubuntu-ssh:latest


it is done, the image is ready in docker hub how this image https://hub.docker.com/r/cirelramos/ubuntu-ssh



0 comentarios :