Detailed explanation of the process of building and running Docker containers

Detailed explanation of the process of building and running Docker containers

Simply pull the image, create a container and run the container:

docker run -d --restart=always \
--privileged=true \
--net=host \
--name=fastdfs \
-e IP=192.168.149.128 \
-e WEB_PORT=80 \
-v ${HOME}/fastdfs:/var/local/fdfs registry.cn-beijing.aliyuncs.com/tianzuo/fastdfs 

Where -v ${HOME}/fastdfs:/var/local/fdfs means:

Mount the ${HOME}/fastdfs directory to the /var/local/fdfs directory in the container.

So the uploaded files will be persisted to ${HOME}/fastdfs/storage/data.

The IP is followed by your own server public network IP or virtual machine IP, -e WEB_PORT=80 specifies the nginx port

Access the container:

docker exec -it fastdfs /bin/bash

Append text information to the index.html file

echo "Hello FastDFS!">>index.html

Upload this file?

fdfs_test /etc/fdfs/client.conf upload index.html

Printed a piece of information:

This is FastDFS client test program v5.12

Copyright (C) 2008, Happy Fish / YuQing

FastDFS may be copied only under the terms of the GNU General
Public License V3, which may be found in the FastDFS source kit.
Please visit the FastDFS Home Page http://www.csource.org/ 
for more details.

[2020-08-12 17:35:41] DEBUG - base_path=/var/local/fdfs/storage, connect_timeout=30, network_timeout=60, tracker_server_count=1, anti_steal_token=0, anti_steal_secret_key length=0, use_connection_pool=0, g_connection_pool_max_idle_time=3600s, use_storage_id=0, storage server id count: 0

tracker_query_storage_store_list_without_group: 
  server 1. group_name=, ip_addr=my ip, port=23000

group_name=group1, ip_addr=my ip, port=23000
storage_upload_by_filename
group_name=group1, remote_filename=M00/00/00/rBEAB180KG2Ab6N2AAAAHhkaK9M13.html
source ip address: 172.17.0.7
file timestamp=2020-08-12 17:35:41
file size=30
file crc32=421145555
example file url: http://myip/group1/M00/00/00/rBEAB180KG2Ab6N2AAAAHhkaK9M13.html
storage_upload_slave_by_filename
group_name=group1, remote_filename=M00/00/00/rBEAB180KG2Ab6N2AAAAHhkaK9M13_big.html
source ip address: 172.17.0.7
file timestamp=2020-08-12 17:35:41
file size=30
file crc32=421145555
example file url: http://myip/group1/M00/00/00/rBEAB180KG2Ab6N2AAAAHhkaK9M13_big.html 

You can access it by following the address generated by the prompt.

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:
  • Docker container orchestration implementation process analysis
  • Docker data volume container creation and usage analysis
  • Detailed explanation of Docker container data volumes
  • How to generate a docker image and complete container deployment in a spring boot project
  • How to install kibana tokenizer inside docker container
  • Detailed explanation of Docker's most commonly used image commands and container commands
  • 10 bad habits to avoid in Docker container applications
  • Detailed explanation of Docker container network port configuration process

<<:  MySQL 4 common master-slave replication architectures

>>:  Some suggestions on Vue code readability

Recommend

Detailed explanation of the functions and usage of MySQL common storage engines

This article uses examples to illustrate the func...

Several solutions for forgetting the MySQL password

Solution 1 Completely uninstall and delete all da...

Introduction to HTML page source code layout_Powernode Java Academy

Introduction to HTML page source code layout This...

Two ways to install the Linux subsystem in Windows 10 (with pictures and text)

Windows 10 now supports Linux subsystem, saying g...

Vue implements a simple shopping cart example

This article shares the specific code of Vue to i...

Summary of MySql storage engine and index related knowledge

Storage Engine What is a database storage engine?...

Detailed explanation of persistent storage of redis under docker

In this chapter, we will start to operate redis i...

In-depth analysis of the diff algorithm in React

Understanding of diff algorithm in React diff alg...

MySQL joint table query basic operation left-join common pitfalls

Overview For small and medium-sized projects, joi...

Example of how to set up a third-level domain name in nginx

Problem Description By configuring nginx, you can...

Detailed explanation of the life cycle of Angular components (Part 2)

Table of contents 1. View hook 1. Things to note ...

Thirty HTML coding guidelines for beginners

1. Always close HTML tags In the source code of p...