英文:
Creating a super use with docker-compose
问题
我尝试使用以下命令来创建超级用户,但一直收到错误消息:
docker-compose -f docker-compose-deploy.yml run --rm app sh -c "python manage.py createsuperuser"
错误信息是:Error response from daemon: No such container: 3316a457be585979396635f940978c6942eaf969da69f7f86fc4dba6375fd923
然而,当我运行 docker ps
时,没有列出任何容器。如何避免这个错误?
英文:
Am new to docker and am trying to create a super user using this command:
docker-compose -f docker-compose-deploy.yml run --rm app sh -c "python manage.py
createsuperuser"
I keep getting Error response from daemon: No such container: 3316a457be585979396635f940978c6942eaf969da69f7f86fc4dba6375fd923
However, when I ran docker ps
, There are no containers listed.
How do I avoid this error?
答案1
得分: 1
请尝试运行以下命令,确保已删除容器或更改了其名称:
docker-compose run --rm app sh -c "python manage.py createsuperuser"
另外,请确保在您的 docker-compose.yml
文件中定义了 app
服务。
英文:
Double check if you removed the container or changed its name. Try to run:
docker-compose run --rm app sh -c "python manage.py createsuperuser"
instead.
Also make sure you defined the app service in your docker-compose.yml
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论