Skip to content

Conversation

@Mathos1432
Copy link
Contributor

@Mathos1432 Mathos1432 commented Jan 31, 2022

Why is this change being made?

  1. We're currently pushing our images to my personal dockerhub, but we should have them in ACR.
    This will allow us to give access to people who need them and move us away from using a personal dockerhub.

  2. Our docker image isn't working currently, it's trying to run dotnet DataGateway.Service.dll, but that dll has been renamed Azure.DataGateway.dll.

What changed?

  1. Updated which repository this pushes to, so we're pointing to ACR instead of my personal DockerHub.
  2. Update dockerfile with the correct dll name, and to do a multistage build which results in a smaller image and we no longer have to manually build the code before running docker build.
  3. Updated the GettingStarted documentation.
  4. Added docker compose files.
  5. Updated our project config to only copy our config files when building Debug so they don't included in our docker images.

How was this validated?

  • Build pipeline will run as part of PR process and should validate the change.
  • Validated that the image got pushed properly to hawaiiacr.azurecr.io/hawaii and that I could pull it with docker pull.
  • Validated that docker compose -f docker-compose-cosmos.yml up booted a container image and was accessible through postman.
  • Only users with permissions are able to pull these images now, Sean validated (thank you!) that he didn't have access at the moment.

…try instead of DockerHub

Change docker image location from DockerHub to Azure Container Registry
Copy link
Contributor

@seantleonard seantleonard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, Matt. Do you mind updating PR description to include sentence how this new registry keeps the container private internally until we are ready for preview? I'm not familiar with whether that folder is public or not.

Copy link
Collaborator

@Aniruddh25 Aniruddh25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jarupatj
Copy link
Contributor

jarupatj commented Feb 1, 2022

Can you update README on how to consume/use this docker image?

@Mathos1432 Mathos1432 changed the title Update build-pipelines.yml to push images to Azure Container Registry instead of personal docker hub Push docker images to Azure Container Registry instead of personal docker hub, Fix our docker image and add docker-compose files. Feb 1, 2022
@Mathos1432
Copy link
Contributor Author

@Aniruddh25 I'll need to update the config files I'm linking to in the docker compose files I added once #181 is checked in.

Copy link
Contributor

@seantleonard seantleonard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for validating! just a few clarification comments as follow up to your recent commits.

Copy link
Collaborator

@Aniruddh25 Aniruddh25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, need few more config file changes.

# Build a docker image and push it to the container registry.
- task: Docker@2
displayName: "Build and push docker image to Azure Container Registry"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought for future changes: this step could be set to only run upon merging to main instead of subsequent updates to a pending PR. Not sure we'd want pending PR changes to be published in an image to our ACR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, but I'd probably do that in a separate change since I need to look into how it would work.

</Content>
<Content Include="PostgreSqlBooks.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>$(CopyToOutputDirectoryAction)</CopyToOutputDirectory>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How accessible are the files within a container image? the .sql files are for configuring a database prior to starting the runtime, so may not have much utility being copied to output directory.

Copy link
Contributor Author

@Mathos1432 Mathos1432 Feb 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, then we probably don't need them to be copied to the output directory. I kept the existing behavior, but I can change it to never copy

5. The container should be accessible at localhost:5000

## Managing the Pipeline
The pipeline has permissions to push to this ACR through this service connection in ADO: https://msdata.visualstudio.com/CosmosDB/_settings/adminservices?resourceId=6565800e-5e71-4e19-a610-6013655382b5.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this :)

@Mathos1432 Mathos1432 linked an issue Feb 2, 2022 that may be closed by this pull request
Copy link
Collaborator

@Aniruddh25 Aniruddh25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Mathos1432 Mathos1432 merged commit 5b08038 into main Feb 3, 2022
@Mathos1432 Mathos1432 deleted the user/matrembl/docker-registry branch February 3, 2022 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

config file loading for docker scenario.

5 participants