Skip to content

Conversation

@ramonsmits
Copy link
Member

@ramonsmits ramonsmits commented Sep 4, 2023

  • Optimized building of docker images by significantly reducing the IO to the docker daemon when running docker build and reduced the number of layers by combining ADD and ENV commands
  • Bumped the base image to mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2022 this image is "only" 4.3GB, further reducing build IO and container runtime size
  • Added docker sample to test the servicecontrol containers with rabbitmq
  • Artifacts to push to docker daemon and the generated docker files are now written in the ServiceControl.DockerImages project output folder

@ramonsmits ramonsmits self-assigned this Sep 4, 2023
@ramonsmits ramonsmits changed the base branch from master to settings September 4, 2023 21:04
@ramonsmits ramonsmits changed the title Docker Resolve docker build issues Sep 4, 2023
Base automatically changed from settings to master September 5, 2023 16:15
Copy link
Member

@DavidBoike DavidBoike left a comment

Choose a reason for hiding this comment

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

I'm going to need a walkthrough of these changes but something does have to change with the gitignore path.

…hed to docker deamon and ignoring artifacts in deploy folder that are not needed for docker build and optimized docker file templates by combining ENV and ADD commands to reduce layers and speed up creation.
…-ltsc2022

After analysis it is clear that targeting only the 4.8 tag results in the Windows 2016 base image which we don't need. Specifically targeting "windowsservercore-ltsc2022" as that is the smallest base image. Targeting .NET Framework 4.8 as we don't need any features of 4.8.1

Output of `docker images --digests`:

```
mcr.microsoft.com/dotnet/framework/runtime                                        4.8                                sha256:c63027269c60b6e817900bd003a4600d3e3b6962ca05b24ea50a8bd2ea3a0b1e   41b175c021d2   3 weeks ago    12.2GB
mcr.microsoft.com/dotnet/framework/runtime                                        4.8                                sha256:dfe0e4ab872aab24b97e6a86069963b4686fdcbbe67f61257a437f92d7d9bef8   41b175c021d2   3 weeks ago    12.2GB
mcr.microsoft.com/dotnet/framework/runtime                                        4.8-windowsservercore-ltsc2016     sha256:c63027269c60b6e817900bd003a4600d3e3b6962ca05b24ea50a8bd2ea3a0b1e   41b175c021d2   3 weeks ago    12.2GB
mcr.microsoft.com/dotnet/framework/runtime                                        4.8-windowsservercore-ltsc2016     sha256:dfe0e4ab872aab24b97e6a86069963b4686fdcbbe67f61257a437f92d7d9bef8   41b175c021d2   3 weeks ago    12.2GB
mcr.microsoft.com/dotnet/framework/runtime                                        latest                             sha256:c63027269c60b6e817900bd003a4600d3e3b6962ca05b24ea50a8bd2ea3a0b1e   41b175c021d2   3 weeks ago    12.2GB
mcr.microsoft.com/dotnet/framework/runtime                                        latest                             sha256:dfe0e4ab872aab24b97e6a86069963b4686fdcbbe67f61257a437f92d7d9bef8   41b175c021d2   3 weeks ago    12.2GB
mcr.microsoft.com/dotnet/framework/runtime                                        4.8.1                              sha256:6a087b1a776023aa636f30960897e9f30d252a7ad310b5fc429456203643d0c6   0df1b551c876   3 weeks ago    5.39GB
mcr.microsoft.com/dotnet/framework/runtime                                        4.8.1                              sha256:bb0f56ad8bb606bdd113881d5a2296685acb5a8d8cae09cc9ad4da5089a8dd15   0df1b551c876   3 weeks ago    5.39GB
mcr.microsoft.com/dotnet/framework/runtime                                        4.8.1-windowsservercore-ltsc2022   sha256:6a087b1a776023aa636f30960897e9f30d252a7ad310b5fc429456203643d0c6   0df1b551c876   3 weeks ago    5.39GB
mcr.microsoft.com/dotnet/framework/runtime                                        4.8.1-windowsservercore-ltsc2022   sha256:bb0f56ad8bb606bdd113881d5a2296685acb5a8d8cae09cc9ad4da5089a8dd15   0df1b551c876   3 weeks ago    5.39GB
mcr.microsoft.com/dotnet/framework/runtime                                        4.8-windowsservercore-ltsc2022     sha256:5bbc1f0666ae0709c9f8772bc11428eb123537dae4d74d80d5dd8750e6a32099   98cb310f7a66   3 weeks ago    4.29GB
```
@ramonsmits ramonsmits marked this pull request as ready for review September 6, 2023 11:19
DavidBoike and others added 3 commits September 7, 2023 09:53
Co-authored-by: David Boike <david.boike@gmail.com>
…from `~/deploy` folder to push to docker daemon. Removed the need for `~/dockerfiles/.gitignore`
@ramonsmits ramonsmits requested a review from bording September 12, 2023 09:57
…tifacts from `~/deploy` folder to push to docker daemon. Removed the need for `~/dockerfiles/.gitignore`"

This reverts commit a80c233.

# Conflicts:
#	src/ServiceControl.DockerImages/ServiceControl.DockerImages.csproj
@ramonsmits ramonsmits dismissed bording’s stale review September 14, 2023 12:32

Addressed feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants