SumiForum
    • Categories
    • Recent
    • Tags
    • Popular
    • Games
      • MFME
      • Virtual Pinball
    • Register
    • Login

    How to create and upload a Docker Image from a Dockerfile

    Scheduled Pinned Locked Moved Docker
    1 Posts 1 Posters 53 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • SumisuS Offline
      Sumisu Administrator
      last edited by

      If you are wanting to upload your image to Docker, then you will need to make sure that you are logged in with the terminal. To do that you can follow this link and it will explain how to do that. Click Here


      In the folder that your Dockerfile is in, run this command:

      sudo docker build -t image_name .
      

      Replace image_name with the name that you want to use for your Docker Image.


      Next we need to set the version of your image. To do that use this command:

      sudo docker tag image_name:latest docker_username/image_name:tag
      

      Replace image_name in both areas of the command with the same name that you used in the first step. Then replace docker_username with your DockerHub username. You will also need to specify a tag for your Docker Image. By default it will be latest, but if you have a specific version of your image you are building, you would put it here.


      The last step is pushing our file to DockerHub. To do that we need to run this command:

      sudo docker push docker_username/image_name:tag
      

      You’ll need to update docker_username, image_name and tag to whatever you put in the last command.

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post
      Forum Stats

      0

      Online

      3

      Users

      30

      Topics

      30

      Posts

      Ad

      © 2024 Sumisu

      • Home
      • Categories
      • Popular