The Docker image size provided by Opentext for the Content Server is a ~3.5GB tar file:
[dmadmin@dctm202 ~]$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE contentserver/centos/stateless/cs 20.2.0000.0110 f83cfb099daf 3 weeks ago 3.48GB
But if you run the image, you’ll see that the actual size of the container is ~2.6GB.
This difference comes from the intermediate layers stored on the original image. If you want to have a smaller image, you could export the container to a .tar file, but if you do this, you will lose all the default configurations required for running the container (ports exposed, entry point, etc.). But there’s a workaround to get a working trimmed image:
- Get docker-rebase script from https://github.com/docbill/docker-scripts
- Load Opentext’s image and create a new container overriding the default entry point (I’ve used bash as new entry point):
docker run -it --entrypoint /bin/bash contentserver/centos/stateless/cs:20.2.0000.0110
- You can be as “aggressive” as you want removing unused stuff. You can skip this point, but I would at least delete all .dll files and aix/hpux/sol/win folders from com.emc.ide.external.dfc_1.0.0/dmbasic on Composer’s plugin folder, as those don’t make sense on a Linux image.
- Run the docker rebase script:
./docker-rebase <CONTAINER_ID> contentserver/centos/stateless/cs:20.2.4
- Export the generated image:
docker save contentserver/centos/stateless/cs:20.2.4 > cs202clean.tar
Now, you’ll have the following:
[dmadmin@dctm202 Scripts]$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE contentserver/centos/stateless/cs 20.2.4 5336da9204b0 34 minutes ago 2.49GB
[…] In the end I create a custom image based on the the one from OT (follow the steps detailed on the Reducing Opentext Documentum 20.2 Docker image size […]
LikeLike
[…] that understanding that concept is a lost battle, however, you would expect that at least OpenText would know by now how to properly build a Docker image. Well, to anyone’s surprise (except to OpenText engineers I guess), latest D2 (22.2) image is […]
LikeLike