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

XHTML Getting Started Tutorial: Form Tags

<br />Forms are an important channel for use...

Introduction to the common API usage of Vue3

Table of contents Changes in the life cycle react...

How to create users and manage permissions in MySQL

1. How to create a user and password 1. Enter the...

HTML page common style (recommended)

As shown below: XML/HTML CodeCopy content to clip...

A brief introduction to VUE uni-app basic components

1. scroll-view When using vertical scrolling, you...

Implementation steps for docker-compose to deploy etcd cluster

Table of contents Write docker-compose.yml Run do...

MySQL 8.0.18 installation tutorial under Windows (illustration)

Download Download address: https://dev.mysql.com/...

Exploring the use of percentage values ​​in the background-position property

How background-position affects the display of ba...

Summary of Mysql update multi-table joint update method

Next, I will create two tables and execute a seri...

Vue code highlighting plug-in comprehensive comparison and evaluation

Table of contents Comprehensive comparison From t...

Detailed explanation of Docker usage under CentOS8

1. Installation of Docker under CentOS8 curl http...

How to ensure that every page of WeChat Mini Program is logged in

Table of contents status quo Solution Further sol...

HTML+css to create a simple progress bar

1. HTML code Copy code The code is as follows: Ex...

Various methods to implement the prompt function of text box in html

You can use the attribute in HTML5 <input="...