This PR aims to avoid chown software installed under /opt to significantly reduce the image size.
chown will introduce a new image layer, which almost double the image size under this project's use cases.
The principle should be leaving software installed under /optroot:root, it should be immutable, move any variable data to /var
It seems that we can not make Ranger happy with this approach, just leave it now.
Before
$ hadoop-testing git:(master) docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hadoop-testing/hadoop-worker3 1-SNAPSHOT 032765fca836 About an hour ago 8.01GB
hadoop-testing/hadoop-worker2 1-SNAPSHOT 486c50957c9b About an hour ago 8.01GB
hadoop-testing/hadoop-worker1 1-SNAPSHOT 7b65e8033da2 About an hour ago 8.01GB
hadoop-testing/hadoop-master1 1-SNAPSHOT 829d32fda382 About an hour ago 12.5GB
After
$ hadoop-testing git:(own) docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hadoop-testing/hadoop-worker3 1-SNAPSHOT 376c86e4e587 3 minutes ago 3.36GB
hadoop-testing/hadoop-worker2 1-SNAPSHOT 39adc56c67bf 3 minutes ago 3.36GB
hadoop-testing/hadoop-worker1 1-SNAPSHOT b3b38cb1208b 4 minutes ago 3.36GB
hadoop-testing/hadoop-master1 1-SNAPSHOT 04192ab1dbf4 4 minutes ago 6.31GB
This PR aims to avoid
chown
software installed under/opt
to significantly reduce the image size.chown
will introduce a new image layer, which almost double the image size under this project's use cases.The principle should be leaving software installed under
/opt
root:root
, it should be immutable, move any variable data to/var
It seems that we can not make Ranger happy with this approach, just leave it now.
Before
After