Редактиране

Споделяне чрез


Deploy to Docker Hub

Docker Hub provides a convenient hosting service for your image repositories. You can easily deploy to Docker Hub manually from Visual Studio.

Create a Docker account and Docker Hub repository

Sign up for a Docker account, if you don't already have one.

If you don't have a Docker Hub repository, create one at Docker Hub.

Publish the image for a single project to Docker Hub

  1. Right-click on the project node and choose Publish.... A screen showing deployment options appears.

    Screenshot of deployment options.

    Screenshot of deployment options.

  2. Choose Docker Container Registry, and then choose Docker Hub.

    Screenshot of Publish dialog - choose Docker Hub.

    Screenshot of Publish dialog - choose Docker Hub.

  3. Enter your Docker credentials.

    Screenshot of Docker Hub dialog.

    Screenshot of Docker Hub dialog.

  4. If you are connecting to your own repository (not part of an organization), leave the checkbox for Publish to a personal repository checked. If the repository is owned by an organization, clear the checkbox, and enter the organization name. Enter your Docker username and password for your Docker account that has permissions to access the repository that you are connecting to, and then select Save.

    Visual Studio attempts to deploy your image to the Docker Hub. If successful, the Publish screen appears with the URL for the repository image, the image tag, repository, and the build configuration (for example, Release).

    Screenshot of Publish screen.

  5. You can update the image at any time by clicking on the Publish button on this page. Or, you can modify or remove the profile, by using the links underneath the URL.

Next steps

Publish to Azure Container Registry by following the steps at Deploy to Azure Container Registry.

Set up continuous integration and delivery (CI/CD) with Azure Pipelines.