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

How to use Docker to package and deploy images locally

First time using docker to package and deploy ima...

NodeJS realizes image text segmentation

This article shares the specific code of NodeJS t...

MySQL select results to perform update example tutorial

1. Single table query -> update UPDATE table_n...

How to reduce the memory and CPU usage of web pages

<br />Some web pages may not look large but ...

How to Dockerize a Python Django Application

Docker is an open source project that provides an...

How to query json in the database in mysql5.6 and below

When saving data in MySQL, sometimes some messy a...

Zabbix's psk encryption combined with zabbix_get value

Since Zabbix version 3.0, it has supported encryp...

Beginner's guide to building a website ⑥: Detailed usage of FlashFXP

Today I will introduce the most basic functions of...

Explanation of the configuration and use of MySQL storage engine InnoDB

MyISAM and InnoDB are the most common storage eng...

Solution to prevent caching in pages

Solution: Add the following code in <head>: ...

A brief analysis of Vue's asynchronous update of DOM

Table of contents The principle of Vue asynchrono...

Introduction to who command examples in Linux

About who Displays users logged into the system. ...