Implementation of modifying configuration files in Docker container

Implementation of modifying configuration files in Docker container

1. Enter the container

docker run [option] image name [command passed to the startup container]

Description of common optional parameters:

  • -i means running the container in "interactive mode"
  • -t means that the container will enter its command line after it starts. After adding these two parameters, you can log in to the container after it is created. That is, allocate a pseudo terminal.
  • --name Name the created container
  • -v indicates the directory mapping relationship (the former is the host directory, and the latter is the directory mapped to the host, that is, host directory: directory in the container). Multiple -v can be used to map multiple directories or files. Note: It is best to do directory mapping, make changes on the host machine, and then share it to the container.
  • -d If you add the -d parameter after run, a guarded container will be created and run in the background (in this way, you will not automatically log in to the container after creating it. If you only add the -i -t parameters, you will automatically enter the container after creation).
  • -p means port mapping. The former is the host port and the latter is the mapping port in the container. You can use multiple -p to map multiple ports.
  • -e sets environment variables for the container
  • --network=host means mapping the host's network environment to the container, and the container's network is the same as the host's

2. Find the configuration file

# Display file ls
The results are as follows:
LICENSE.txt README.textile config lib modules
NOTICE.txt bin data logs plugins
 
# Enter the configuration folder cd config
 
# Display file ls
The results are as follows:
elasticsearch.keystore ingest-geoip log4j2.properties roles.yml users_roles
elasticsearch.yml jvm.options role_mapping.yml users
 
# Modify the configuration file vi elasticsearch.yml

When using the docker container, Vi may not be installed. apt-get install vim . If it prompts: Unable to locate package vim, you need to type: apt-get update update. After the update is complete, type the command: apt-get install vim

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • How to set port mapping for running container in Docker
  • How to modify the contents of an existing Docker container
  • How to view files in Docker image
  • Docker file storage path, modify port mapping operation mode

<<:  A brief discussion on how to write beautiful conditional expressions in JS

>>:  In-depth analysis of the Identifier Case Sensitivity problem in MySQL

Recommend

Vue echarts realizes horizontal bar chart

This article shares the specific code of vue echa...

What are the attributes of the JSscript tag

What are the attributes of the JS script tag: cha...

Solution for Baidu site search not supporting https (tested)

Recently, https has been enabled on the mobile ph...

How to open MySQL binlog log

binlog is a binary log file, which records all my...

Complete steps to install MySQL 5.5 on CentOS

Table of contents 1. Preparation before installat...

Creation, constraints and deletion of foreign keys in MySQL

Preface After MySQL version 3.23.44, InnoDB engin...

How to manually deploy war packages through tomcat9 on windows and linux

The results are different in Windows and Linux en...

SASS Style Programming Guide for CSS

As more and more developers use SASS, we need to ...

Complete steps to install FFmpeg in CentOS server

Preface The server system environment is: CentOS ...

Linux kernel device driver virtual file system notes

/******************** * Virtual File System VFS *...

Detailed explanation of SSH password-free login configuration under Linux

Assume there are two Linux servers A and B, and w...

Detailed explanation of Vue lazyload picture lazy loading example

Documentation: https://github.com/hilongjw/vue-la...

40 CSS/JS style and functional technical processing

1- Styling dropdown select boxes - Modify the dro...