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

JavaScript implements fireworks effects with sound effects

It took me half an hour to write the code, and th...

Summarize the problems encountered in using Vue Element UI

Table of contents 1. DateTimePicker date selectio...

MySQL Installer 8.0.21 installation tutorial with pictures and text

1. Reason I just needed to reinstall MySQL on a n...

JS Decorator Pattern and TypeScript Decorators

Table of contents Introduction to the Decorator P...

Summary of various methods of implementing article dividing line styles with CSS

This article summarizes various ways to implement...

Example of using CSS to achieve semi-transparent background and opaque text

This article introduces an example of how to use ...

Docker's health detection mechanism

For containers, the simplest health check is the ...

Implementation of Docker deployment of SQL Server 2019 Always On cluster

Table of contents Docker deployment Always on clu...

MySQL log settings and viewing methods

MySQL has the following logs: Error log: -log-err...

MySQL spatial data storage and functions

Table of contents 1. Data Type 1. What is MySQL s...

Introduction to the use of alt and title attributes of HTML img tags

When browser vendors bend the standards and take i...

Configuring MySQL and Squel Pro on Mac

In response to the popularity of nodejs, we have ...

Two ways to configure Vue global methods

Table of contents 1. Introduction 2. The first me...

DOCTYPE element detailed explanation complete version

1. Overview This article systematically explains ...