alex.w
alex.w

Reputation: 21

How can I edit tomcat configuration files inside the docker container?

I am trying to nano/vim inside a docker container to edit the tomcat config files but i am getting an error that nano/vim is unknown command. I tried to yum install, still yum is unknown comand. How do I go about it

Upvotes: 1

Views: 1342

Answers (1)

Sergei
Sergei

Reputation: 893

The most common editor is vi. To install some packages into your container you have to know it's base image. Most of distros create a special file in /etc/ with all necessary information: something-release, you can find it out with this command:

cat /etc/*release

And then use the package manager of current distro.

  • for Alpine it will be apk update && apk add vim.
  • for Ubuntu/Debian - apt update && apt install vim.
  • for Centos/RedHat/Fedora - yum install vim
  • etc

Upvotes: 3

Related Questions