How to install new packages into non-root Docker Container?

后端 未结 3 1497
难免孤独
难免孤独 2021-01-31 14:14

I\'m trying to extend a docker container for SOLR. I just want to install vim into it. But when I run the docker build it complains that I\'m not root.

This

3条回答
  •  甜味超标
    2021-01-31 14:29

    Similar suggestion to the previous answer https://stackoverflow.com/a/37615312/2200690, open an interactive shell as the root user and then install your packages using apt-get.

    docker exec --user="root" -it  /bin/bash
    

    install the package

    apt-get install package
    

提交回复
热议问题