0

I want to create a specific image that just contains windowsservercore, Chrome and some other custom installs/commands. I'm aware that I can just tag this image and then push it to my local Docker registry.

The goal is to not have to recreate the wheel each time I need to create a container for testing. Let's say I call this image localhost:5000\SeleniumChrome:105.

Now I want to create a new image based off of this image and add to it a specific .NET Core SDK, let's say 6.0.

So in my new dockerfile, I'm assuming one way I can do this is:

FROM localhost:5000\SeleniumChrome:105
-- Download the .NET Core SDK and install it
-- Do other stuff

Build this new image, name and tag it.

OR

Can I somehow merge two images, one my own and another a Microsoft official image?

FROM localhost:5000\SeleniumChrome:105
FROM mcr.microsoft.com\dotnet\sdk:6.0
--do my own thing

Basically I am trying to inherit existing images and combine them into a new image so I don't have to go through the whole process each time.

Charles Owen
  • 2,403
  • 1
  • 14
  • 25
  • There's no way to combine images; you need to start `FROM` some specific base and `RUN` install commands for the other tools into it. (What should happen if one image is built on Alpine Linux and the other on Debian, and their system libraries and tools are completely different; how would Docker merge the two `/lib/libc.so.6` or `/bin/sh` files?) – David Maze Sep 25 '22 at 11:23

0 Answers0