The problem and solution of using docker storage and causing Exit to cause files to fail to upload to the server

The problem and solution of using docker storage and causing Exit to cause files to fail to upload to the server

1. Problem description

The storage installed in the docker container has been in the exit state, resulting in the inability to store files.

2. Solution

View the containers installed in Docker

docker ps -a

Try starting the container

docker start storage (or docker start "container ID")

If the container is still in the exited state after trying to start it, delete the container

docker container rm storage (or docker container rm "container ID")

Enter the /var/fdfs folder and delete the storage file

cd /var/fdfs
sodo rm -r storage

Reinstall the storage container

sudo docker run -dti --network=host --name storage -e TRACKER_SERVER=10.0.2.15(intranet ip):22122 -v /var/fdfs/storage:/var/fdfs delron/fastdfs storage

Check whether the container is started successfully

3. Test whether the container can be used normally

Note: To test in Python's Django module, you need to install the fdfs_client module

pip3 install fdfs_client

Enter the Django shell environment

python manage.py shell

Write in the shell environment

from fdfs_client.client import Fdfs_client

# client.conf is the configuration file fdfs = Fdfs_client('utils/fastdfs/client.conf')

# Upload the file by file name fdfs.upload_by_filename('media/2018.png')

Get the response back

Test whether the path is successful

http://127.0.0.1:8888/group1/M00/00/00/CgACD17bAsqACuoXAAfh_rrm7jw614.png

Summarize

This is the end of this article about the problem and solution of docker using storage and exit causing files to be unable to upload to the server. For more related content about docker using storage and exit causing files to be unable to upload to the server, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • docker pure-ftp How to build an ftp server
  • Centos7 uses docker to build gitlab server
  • How to build a DNS server with Docker in 1 minute

<<:  SQL injection vulnerability process example and solution

>>:  MySQL MyISAM default storage engine implementation principle

Recommend

Detailed explanation of the basic use of react-navigation6.x routing library

Table of contents react-native project initializa...

Quickly install MySQL5.7 compressed package on Windows

This article shares with you how to install the M...

MySQL multi-instance installation boot auto-start service configuration process

1.MySQL multiple instances MySQL multi-instance m...

Web page html special symbols html special characters comparison table

Special symbols Named Entities Decimal encoding S...

Implementation of code optimization for Vue2.x project performance optimization

Table of contents 1 Use of v-if and v-show 2. Dif...

Discussion on the way to open website hyperlinks

A new window opens. Advantages: When the user cli...

How to deploy Confluence and jira-software in Docker

version: centos==7.2 jdk==1.8 confluence==6.15.4 ...

50 Beautiful FLASH Website Design Examples

Flash enabled designers and developers to deliver...

MySQL 5.6 compressed package installation method

There are two installation methods for MySQL: msi...

Introduction to Docker Architecture

Docker includes three basic concepts: Image: A Do...

A brief introduction to Tomcat's overall structure

Tomcat is widely known as a web container. It has...

Detailed process of using vmware to test PXE batch installation server

Table of contents 1. Preparation 1. Prepare the e...

Learn about JavaScript closure functions in one article

Table of contents Variable Scope The concept of c...