Implementation of Docker Container Modification Profile
- 2021-06-28 09:52:54
- OfStack
1. Enter the container
docker run [option] Mirror Name [Command passed into boot container]
Description of commonly used optional parameters:
-i means to run the container in "interactive mode" -t indicates that the container will enter its command line when it is started.With these two parameters added, container creation can log in.A pseudo-terminal is assigned. --name Names the container created -v denotes a directory mapping relationship (the former is a host directory, the latter is a directory mapped to the host, that is, a host directory: a directory in a container), and multiple-vs can be used to map multiple directories or files.Note: It is best to make directory mappings, make modifications on the host machine, and then share them to containers. When -d is followed by the -d parameter, a daemon container is created to run in the background (so the container is not automatically logged in after it is created, and if -i -t is added only, the container is automatically entered after creation). -p represents a port mapping, the former being a host port and the latter a mapped port within a container.Multiple port mappings can be done using multiple-ps -e Sets environment variables for containers --network=host indicates that the host's network environment is mapped to a container with the same network as the host
2. Find the configuration file
# Show Files
ls
The results are as follows:
LICENSE.txt README.textile config lib modules
NOTICE.txt bin data logs plugins
# Enter Configuration Folder
cd config
# Show Files
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 Profile
vi elasticsearch.yml
When using the docker container, Vi may not be installed, Vi:
apt-get install vim
, if prompted: Unable to locate package vim, you need to hit:
apt-get update
, wait until the update is complete before typing the command:
apt-get install vim