簡體   English   中英

我無法在 Windows 7 上啟動我的 Docker 容器

[英]I can't start my Docker container on Windows 7

我的電腦在 Windows 7 x64 上運行,它是域的一部分。 坦率地說,我並沒有考慮在不久的將來遷移到 Windows 10 Pro,盡管我沒有意識到我離安裝它有多近。

我最近開始閱讀 Django for Professionals 3.0: Production Websites with Python & Django by William S. Vincent,第一個障礙是

Docker 桌面只能安裝在 Windows 10 因此我下載了 Docker 工具箱。 虛擬機無緣無故不想啟動....我嘗試將 Oracle VM VirtualBox 5.2.x 版本升級到 6.1.10。 最后它工作了,盡管它總是想以管理員身份運行。 我不知道 /Users/Administrator 中的某些文件(.docker)和 /Users/notebook 中的其他文件(如 pipenv 的 .virtualenv)是否重要.....

無論如何....接近重點....我無法啟動我的容器。

書上寫的代碼

這是我終端中的過程:

    Starting "default"...
(default) Check network to re-create if needed...
(default) Windows might ask for the permission to configure a dhcp server. Somet
imes, such confirmation window is minimized in the taskbar.
(default) Waiting for an IP...
Machine "default" was started.
Waiting for SSH to be available...
Detecting the provisioner...
Started machines may have new IP addresses. You may need to re-run the `docker-m
achine env` command.
Regenerate TLS machine certs?  Warning: this is irreversible. (y/n): Regeneratin
g TLS certificates
Waiting for SSH to be available...
Detecting the provisioner...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...



                        ##         .
                  ## ## ##        ==
               ## ## ## ## ##    ===
           /"""""""""""""""""\___/ ===
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
           \______ o           __/
             \    \         __/
              \____\_______/

docker is configured to use the default machine with IP 192.168.99.100
For help getting started, check out the docs at https://docs.docker.com


Start interactive shell

Administrator@notebook-pc MINGW64 /c/Program Files/Docker Toolbox
$ cd C:/python/django_professionals/chapter1/postgresql

Administrator@notebook-pc MINGW64 /c/python/django_professionals/chapter1/postgr
esql
$ docker build .
Sending build context to Docker daemon  168.4kB
Step 1/7 : FROM python:3.8
 ---> 7f5b6ccd03e9
Step 2/7 : ENV PYTHONDONTWRITEBYTECODE 1
 ---> Using cache
 ---> 7b68f08f6658
Step 3/7 : ENV PYTHONUNBUFFERED 1
 ---> Using cache
 ---> 6cf532d90680
Step 4/7 : WORKDIR /code
 ---> Using cache
 ---> c870b6c66708
Step 5/7 : COPY Pipfile Pipfile.lock /code/
 ---> 55b431e61e7e
Step 6/7 : RUN pip install pipenv && pipenv install --system
 ---> Running in c5aa07e5ac12
Collecting pipenv
  Downloading pipenv-2020.6.2-py2.py3-none-any.whl (3.9 MB)
Collecting virtualenv-clone>=0.2.5
  Downloading virtualenv_clone-0.5.4-py2.py3-none-any.whl (6.6 kB)
Collecting virtualenv
  Downloading virtualenv-20.0.21-py2.py3-none-any.whl (4.7 MB)
Collecting certifi
  Downloading certifi-2020.4.5.2-py2.py3-none-any.whl (157 kB)
Requirement already satisfied: pip>=18.0 in /usr/local/lib/python3.8/site-packag
es (from pipenv) (20.1.1)
Requirement already satisfied: setuptools>=36.2.1 in /usr/local/lib/python3.8/si
te-packages (from pipenv) (47.1.1)
Collecting distlib<1,>=0.3.0
  Downloading distlib-0.3.0.zip (571 kB)
Collecting six<2,>=1.9.0
  Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
Collecting filelock<4,>=3.0.0
  Downloading filelock-3.0.12-py3-none-any.whl (7.6 kB)
Collecting appdirs<2,>=1.4.3
  Downloading appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Building wheels for collected packages: distlib
  Building wheel for distlib (setup.py): started
  Building wheel for distlib (setup.py): finished with status 'done'
  Created wheel for distlib: filename=distlib-0.3.0-py3-none-any.whl size=340427
 sha256=ffd8dd029b231bab7f36c48a93deb41ebc003d83bbb76c6782ecb980bb4af9fb
  Stored in directory: /root/.cache/pip/wheels/eb/4e/d2/a903d4184fb49e4ac06474d6
5715b129aee13d69f7d227e78e
Successfully built distlib
Installing collected packages: virtualenv-clone, distlib, six, filelock, appdirs
, virtualenv, certifi, pipenv
Successfully installed appdirs-1.4.4 certifi-2020.4.5.2 distlib-0.3.0 filelock-3
.0.12 pipenv-2020.6.2 six-1.15.0 virtualenv-20.0.21 virtualenv-clone-0.5.4
Installing dependencies from Pipfile.lock (a6086c)
Failed to load paths: /bin/sh: 1: /root/.local/share/virtualenvs/code-_Py8Si6I/b
in/python: not found

Output:
Failed to load paths: /bin/sh: 1: /root/.local/share/virtualenvs/code-_Py8Si6I/b
in/python: not found

Output:
Failed to load paths: /bin/sh: 1: /root/.local/share/virtualenvs/code-_Py8Si6I/b
in/python: not found

Output:
Removing intermediate container c5aa07e5ac12
 ---> cf8a416ce267
Step 7/7 : COPY . /code/
 ---> b427660ce873
Successfully built b427660ce873
SECURITY WARNING: You are building a Docker image from Windows against a non-Win
dows Docker host. All files and directories added to build context will have '-r
wxr-xr-x' permissions. It is recommended to double check and reset permissions f
or sensitive files and directories.

Administrator@notebook-pc MINGW64 /c/python/django_professionals/chapter1/postgr
esql
$ docker-compose up -d
Creating network "postgresql_default" with the default driver
Building web
Step 1/7 : FROM python:3.8
 ---> 7f5b6ccd03e9
Step 2/7 : ENV PYTHONDONTWRITEBYTECODE 1
 ---> Using cache
 ---> 7b68f08f6658
Step 3/7 : ENV PYTHONUNBUFFERED 1
 ---> Using cache
 ---> 6cf532d90680
Step 4/7 : WORKDIR /code
 ---> Using cache
 ---> c870b6c66708
Step 5/7 : COPY Pipfile Pipfile.lock /code/
 ---> 5d3f5c973711
Step 6/7 : RUN pip install pipenv && pipenv install --system
 ---> Running in d5ef503bac67
Collecting pipenv
  Downloading pipenv-2020.6.2-py2.py3-none-any.whl (3.9 MB)
Requirement already satisfied: setuptools>=36.2.1 in /usr/local/lib/python3.8/si
te-packages (from pipenv) (47.1.1)
Requirement already satisfied: pip>=18.0 in /usr/local/lib/python3.8/site-packag
es (from pipenv) (20.1.1)
Collecting certifi
  Downloading certifi-2020.4.5.2-py2.py3-none-any.whl (157 kB)
Collecting virtualenv
  Downloading virtualenv-20.0.21-py2.py3-none-any.whl (4.7 MB)
Collecting virtualenv-clone>=0.2.5
  Downloading virtualenv_clone-0.5.4-py2.py3-none-any.whl (6.6 kB)
Collecting appdirs<2,>=1.4.3
  Downloading appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting six<2,>=1.9.0
  Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
Collecting filelock<4,>=3.0.0
  Downloading filelock-3.0.12-py3-none-any.whl (7.6 kB)
Collecting distlib<1,>=0.3.0
  Downloading distlib-0.3.0.zip (571 kB)
Building wheels for collected packages: distlib
  Building wheel for distlib (setup.py): started
  Building wheel for distlib (setup.py): finished with status 'done'
  Created wheel for distlib: filename=distlib-0.3.0-py3-none-any.whl size=340427
 sha256=807dad54d4f8b388d70ae61e233267f44c846319e9c8c24f7dbf4496f9dc3ec9
  Stored in directory: /root/.cache/pip/wheels/eb/4e/d2/a903d4184fb49e4ac06474d6
5715b129aee13d69f7d227e78e
Successfully built distlib
Installing collected packages: certifi, appdirs, six, filelock, distlib, virtual
env, virtualenv-clone, pipenv
Successfully installed appdirs-1.4.4 certifi-2020.4.5.2 distlib-0.3.0 filelock-3
.0.12 pipenv-2020.6.2 six-1.15.0 virtualenv-20.0.21 virtualenv-clone-0.5.4
Installing dependencies from Pipfile.lock (a6086c):
Failed to load paths: /bin/sh: 1: /root/.local/share/virtualenvs/code-_Py8Si6I/b
in/python: not found

Output:
Failed to load paths: /bin/sh: 1: /root/.local/share/virtualenvs/code-_Py8Si6I/b
in/python: not found

Output:
Failed to load paths: /bin/sh: 1: /root/.local/share/virtualenvs/code-_Py8Si6I/b
in/python: not found

Output:
Removing intermediate container d5ef503bac67
 ---> 7d49adf605d1
Step 7/7 : COPY . /code/
 ---> 125b1ac1973c

Successfully built 125b1ac1973c
Successfully tagged postgresql_web:latest
WARNING: Image for service web was built because it did not already exist. To re
build this image you must use `docker-compose build` or `docker-compose up --bui
ld`.
Creating postgresql_web_1 ... done

Administrator@notebook-pc MINGW64 /c/python/django_professionals/chapter1/postgr
esql
$

我能夠運行服務器的唯一方法是在docker-compose.yml中省略volumes參數盡管我得到了與manage.py相關的相同錯誤,但實際的websever仍然運行。 第二個問題是我只能通過虛擬適配器的 IP 地址(如 192.168.99.100)到達網絡服務器。 書中描述的 127.0.0.1 不起作用。

我應該轉到 Windows 10 來解決這個問題還是.... 我應該繼續閱讀在本地機器上實現代碼的書嗎?

感謝任何幫助!

我在晚上解決了一半的難題。 在構建圖像時,我發現了一行: Downloading pipenv-2020.6.2-py2.py3-none-any.whl它安裝了最新版本的 pipenv。 然后我決定強制它安裝早期版本。 我不知道它是否正確寫雖然它有效。 我在 Dockerfile 中添加了pipenv== 2018.11.26

# Install dependencies
COPY Pipfile Pipfile.lock /code/
RUN pip install pipenv==2018.11.26 && pipenv install --system

我跳過了第 2 章並在本地完成,但是這里是第 3 章的過程:

Step 1/7 : FROM python:3.8
3.8: Pulling from library/python
e9afc4f90ab0: Pulling fs layer
989e6b19a265: Downloading [>                                                  ]
e9afc4f90ab0: Downloading [>                                                  ]
 510.4kB/50.39MBwnloading [>                                                  ]
 101.6kB/9.996MBiting
e9afc4f90ab0: Downloading [=>                                                 ]
e9afc4f90ab0: Downloading [=>                                                 ]
  1.53MB/50.39MBiting
989e6b19a265: Downloading [=====>                                             ]
   920kB/7.812MB
af14b6c2f878: Downloading [====>                                              ]
e9afc4f90ab0: Downloading [==>                                                ]
 2.554MB/50.39MB

e9afc4f90ab0: Downloading [===>                                               ]
 3.066MB/50.39MB

989e6b19a265: Downloading [=============>                                     ]
 2.096MB/7.812MB
e9afc4f90ab0: Downloading [====>                                              ]
 4.086MB/50.39MB

e9afc4f90ab0: Downloading [====>                                              ]
 4.606MB/50.39MB
e9afc4f90ab0: Extracting [===========================================>       ]
e9afc4f90ab0: Extracting [=================================================> ]
50.33MB/50.39MBxtracting [=============================================>     ]
989e6b19a265: Extracting [==========================================>        ]
af14b6c2f878: Extracting [=================================================> ]
 9.83MB/9.996MBxtracting [======================>                            ]
5573c4b30949: Extracting [================================================>  ]
50.33MB/51.83MBxtracting [==============================================>    ]
11a88e764313: Extracting [=================================================> ]
11a88e764313: Extracting [=================================================> ]
ee776f0e36af: Extracting [==================================================>]
ee776f0e36af: Pull complete
513c90a1afc3: Pull complete
df9b9e95bdb9: Extracting [==================================================>]
df9b9e95bdb9: Extracting [==================================================>]
df9b9e95bdb9: Pull complete
86c9edb54464: Pull complete
Digest: sha256:dd6cd8191ccbced2a6af5d0ddb51e6057c1444df14e14bcfd5c7b3ef78738050
Status: Downloaded newer image for python:3.8
 ---> 7f5b6ccd03e9
Step 2/7 : ENV PYTHONDONTWRITEBYTECODE 1
 ---> Running in b28d763d8b67
Removing intermediate container b28d763d8b67
 ---> 4966da35178b
Step 3/7 : ENV PYTHONUNBUFFERED 1
 ---> Running in ab4af6ebaa3f
Removing intermediate container ab4af6ebaa3f
 ---> ca1655c0ba53
Step 4/7 : WORKDIR /code
 ---> Running in be12616879bd
Removing intermediate container be12616879bd
 ---> 238ca146b9f9
Step 5/7 : COPY Pipfile Pipfile.lock /code/
 ---> 90c096a097cf
Step 6/7 : RUN pip install pipenv==2018.11.26 && pipenv install --system
 ---> Running in 3b2aa2611d33
Collecting pipenv==2018.11.26
  Downloading pipenv-2018.11.26-py3-none-any.whl (5.2 MB)
Requirement already satisfied: setuptools>=36.2.1 in /usr/local/lib/python3.8/si
te-packages (from pipenv==2018.11.26) (47.1.1)
Requirement already satisfied: pip>=9.0.1 in /usr/local/lib/python3.8/site-packa
ges (from pipenv==2018.11.26) (20.1.1)
Collecting virtualenv
  Downloading virtualenv-20.0.23-py2.py3-none-any.whl (4.7 MB)
Collecting certifi
  Downloading certifi-2020.4.5.2-py2.py3-none-any.whl (157 kB)
Collecting virtualenv-clone>=0.2.5
  Downloading virtualenv_clone-0.5.4-py2.py3-none-any.whl (6.6 kB)
Collecting filelock<4,>=3.0.0
  Downloading filelock-3.0.12-py3-none-any.whl (7.6 kB)
Collecting six<2,>=1.9.0
  Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
Collecting appdirs<2,>=1.4.3
  Downloading appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting distlib<1,>=0.3.0
  Downloading distlib-0.3.0.zip (571 kB)
Building wheels for collected packages: distlib
  Building wheel for distlib (setup.py): started
  Building wheel for distlib (setup.py): finished with status 'done'
  Created wheel for distlib: filename=distlib-0.3.0-py3-none-any.whl size=340427
 sha256=ca936027ba8b3e15b02cb9a79b68426ee67750091e72c1ed2eb67a27380096c6
  Stored in directory: /root/.cache/pip/wheels/eb/4e/d2/a903d4184fb49e4ac06474d6
5715b129aee13d69f7d227e78e
Successfully built distlib
Installing collected packages: filelock, six, appdirs, distlib, virtualenv, cert
ifi, virtualenv-clone, pipenv
Successfully installed appdirs-1.4.4 certifi-2020.4.5.2 distlib-0.3.0 filelock-3
.0.12 pipenv-2018.11.26 six-1.15.0 virtualenv-20.0.23 virtualenv-clone-0.5.4
Installing dependencies from Pipfile.lock (22c09e):
Removing intermediate container 3b2aa2611d33
 ---> 4e1687c3514f
Step 7/7 : COPY . /code/
 ---> abe16389806f

Successfully built abe16389806f
Successfully tagged books_web:latest
Creating books_db_1 ... done
Creating books_web_1 ... done

Administrator@notebook-pc MINGW64 /c/python/django_professionals/code/books
$ docker-compose logs
Attaching to books_web_1, books_db_1
web_1  | python: can't open file '/code/manage.py': [Errno 2] No such file or di
rectory
db_1   | ***********************************************************************
*********
db_1   | WARNING: POSTGRES_HOST_AUTH_METHOD has been set to "trust". This will a
llow
db_1   |          anyone with access to the Postgres port to access your databas
e without
db_1   |          a password, even if POSTGRES_PASSWORD is set. See PostgreSQL
db_1   |          documentation about "trust":
db_1   |          https://www.postgresql.org/docs/current/auth-trust.html
db_1   |          In Docker's default configuration, this is effectively any oth
er
db_1   |          container on the same system.
db_1   |
db_1   |          It is not recommended to use POSTGRES_HOST_AUTH_METHOD=trust.
Replace
db_1   |          it with "-e POSTGRES_PASSWORD=password" instead to set a passw
ord in
db_1   |          "docker run".
db_1   | ***********************************************************************
*********
db_1   | The files belonging to this database system will be owned by user "post
gres".
db_1   | This user must also own the server process.
db_1   |
db_1   | The database cluster will be initialized with locale "en_US.utf8".
db_1   | The default database encoding has accordingly been set to "UTF8".
db_1   | The default text search configuration will be set to "english".
db_1   |
db_1   | Data page checksums are disabled.
db_1   |
db_1   | fixing permissions on existing directory /var/lib/postgresql/data ... o
k
db_1   | creating subdirectories ... ok
db_1   | selecting dynamic shared memory implementation ... posix
db_1   | selecting default max_connections ... 100
db_1   | selecting default shared_buffers ... 128MB
db_1   | selecting default time zone ... Etc/UTC
db_1   | creating configuration files ... ok
db_1   | running bootstrap script ... ok
db_1   | performing post-bootstrap initialization ... ok
db_1   | syncing data to disk ... ok
db_1   |
db_1   | initdb: warning: enabling "trust" authentication for local connections
db_1   | You can change this by editing pg_hba.conf or using the option -A, or
db_1   | --auth-local and --auth-host, the next time you run initdb.
db_1   |
db_1   | Success. You can now start the database server using:
db_1   |
db_1   |     pg_ctl -D /var/lib/postgresql/data -l logfile start
db_1   |
db_1   | waiting for server to start....2020-06-13 00:12:08.901 UTC [46] LOG:  s
tarting PostgreSQL 12.3 (Debian 12.3-1.pgdg100+1) on x86_64-pc-linux-gnu, compil
ed by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
db_1   | 2020-06-13 00:12:08.902 UTC [46] LOG:  listening on Unix socket "/var/r
un/postgresql/.s.PGSQL.5432"
db_1   | 2020-06-13 00:12:08.919 UTC [47] LOG:  database system was shut down at
 2020-06-13 00:12:08 UTC
db_1   | 2020-06-13 00:12:08.924 UTC [46] LOG:  database system is ready to acce
pt connections
db_1   |  done
db_1   | server started
db_1   |
db_1   | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb
.d/*
db_1   |
db_1   | 2020-06-13 00:12:08.989 UTC [46] LOG:  received fast shutdown request
db_1   | waiting for server to shut down....2020-06-13 00:12:08.992 UTC [46] LOG
:  aborting any active transactions
db_1   | 2020-06-13 00:12:08.996 UTC [46] LOG:  background worker "logical repli
cation launcher" (PID 53) exited with exit code 1
db_1   | 2020-06-13 00:12:08.997 UTC [48] LOG:  shutting down
db_1   | 2020-06-13 00:12:09.009 UTC [46] LOG:  database system is shut down
db_1   |  done
db_1   | server stopped
db_1   |
db_1   | PostgreSQL init process complete; ready for start up.
db_1   |
db_1   | 2020-06-13 00:12:09.130 UTC [1] LOG:  starting PostgreSQL 12.3 (Debian
12.3-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0
, 64-bit
db_1   | 2020-06-13 00:12:09.131 UTC [1] LOG:  listening on IPv4 address "0.0.0.
0", port 5432
db_1   | 2020-06-13 00:12:09.131 UTC [1] LOG:  listening on IPv6 address "::", p
ort 5432
db_1   | 2020-06-13 00:12:09.137 UTC [1] LOG:  listening on Unix socket "/var/ru
n/postgresql/.s.PGSQL.5432"
db_1   | 2020-06-13 00:12:09.152 UTC [55] LOG:  database system was shut down at
 2020-06-13 00:12:09 UTC
db_1   | 2020-06-13 00:12:09.155 UTC [1] LOG:  database system is ready to accep
t connections

Administrator@notebook-pc MINGW64 /c/python/django_professionals/code/books
$ docker-compose up
books_db_1 is up-to-date
Starting books_web_1 ... done
Attaching to books_db_1, books_web_1
db_1   | ***********************************************************************
*********
db_1   | WARNING: POSTGRES_HOST_AUTH_METHOD has been set to "trust". This will a
llow
db_1   |          anyone with access to the Postgres port to access your databas
e without
db_1   |          a password, even if POSTGRES_PASSWORD is set. See PostgreSQL
db_1   |          documentation about "trust":
db_1   |          https://www.postgresql.org/docs/current/auth-trust.html
db_1   |          In Docker's default configuration, this is effectively any oth
er
db_1   |          container on the same system.
db_1   |
db_1   |          It is not recommended to use POSTGRES_HOST_AUTH_METHOD=trust.
Replace
db_1   |          it with "-e POSTGRES_PASSWORD=password" instead to set a passw
ord in
db_1   |          "docker run".
db_1   | ***********************************************************************
*********
db_1   | The files belonging to this database system will be owned by user "post
gres".
db_1   | This user must also own the server process.
db_1   |
db_1   | The database cluster will be initialized with locale "en_US.utf8".
db_1   | The default database encoding has accordingly been set to "UTF8".
db_1   | The default text search configuration will be set to "english".
db_1   |
db_1   | Data page checksums are disabled.
db_1   |
db_1   | fixing permissions on existing directory /var/lib/postgresql/data ... o
k
db_1   | creating subdirectories ... ok
db_1   | selecting dynamic shared memory implementation ... posix
db_1   | selecting default max_connections ... 100
db_1   | selecting default shared_buffers ... 128MB
db_1   | selecting default time zone ... Etc/UTC
db_1   | creating configuration files ... ok
db_1   | running bootstrap script ... ok
db_1   | performing post-bootstrap initialization ... ok
db_1   | syncing data to disk ... ok
db_1   |
db_1   | initdb: warning: enabling "trust" authentication for local connections
db_1   | You can change this by editing pg_hba.conf or using the option -A, or
db_1   | --auth-local and --auth-host, the next time you run initdb.
db_1   |
db_1   | Success. You can now start the database server using:
db_1   |
db_1   |     pg_ctl -D /var/lib/postgresql/data -l logfile start
db_1   |
db_1   | waiting for server to start....2020-06-13 00:12:08.901 UTC [46] LOG:  s
tarting PostgreSQL 12.3 (Debian 12.3-1.pgdg100+1) on x86_64-pc-linux-gnu, compil
ed by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
db_1   | 2020-06-13 00:12:08.902 UTC [46] LOG:  listening on Unix socket "/var/r
un/postgresql/.s.PGSQL.5432"
db_1   | 2020-06-13 00:12:08.919 UTC [47] LOG:  database system was shut down at
 2020-06-13 00:12:08 UTC
db_1   | 2020-06-13 00:12:08.924 UTC [46] LOG:  database system is ready to acce
pt connections
db_1   |  done
db_1   | server started
db_1   |
db_1   | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb
.d/*
db_1   |
db_1   | 2020-06-13 00:12:08.989 UTC [46] LOG:  received fast shutdown request
db_1   | waiting for server to shut down....2020-06-13 00:12:08.992 UTC [46] LOG
:  aborting any active transactions
db_1   | 2020-06-13 00:12:08.996 UTC [46] LOG:  background worker "logical repli
cation launcher" (PID 53) exited with exit code 1
db_1   | 2020-06-13 00:12:08.997 UTC [48] LOG:  shutting down
db_1   | 2020-06-13 00:12:09.009 UTC [46] LOG:  database system is shut down
db_1   |  done
db_1   | server stopped
db_1   |
db_1   | PostgreSQL init process complete; ready for start up.
db_1   |
db_1   | 2020-06-13 00:12:09.130 UTC [1] LOG:  starting PostgreSQL 12.3 (Debian
12.3-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0
, 64-bit
db_1   | 2020-06-13 00:12:09.131 UTC [1] LOG:  listening on IPv4 address "0.0.0.
0", port 5432
db_1   | 2020-06-13 00:12:09.131 UTC [1] LOG:  listening on IPv6 address "::", p
ort 5432
db_1   | 2020-06-13 00:12:09.137 UTC [1] LOG:  listening on Unix socket "/var/ru
n/postgresql/.s.PGSQL.5432"
db_1   | 2020-06-13 00:12:09.152 UTC [55] LOG:  database system was shut down at
 2020-06-13 00:12:09 UTC
db_1   | 2020-06-13 00:12:09.155 UTC [1] LOG:  database system is ready to accep
t connections
web_1  | python: can't open file '/code/manage.py': [Errno 2] No such file or di
rectory
books_web_1 exited with code 2

還有一個問題仍然存在:

web_1 | python:無法打開文件'/code/manage.py':[Errno 2]沒有這樣的文件或目錄

它創建了兩個圖像....創建 books_db_1... 完成 創建 books_web_1... 完成

盡管books_web_1已停止,但它們仍以 Kitematic (Alpha) 顯示。 當我嘗試啟動它時,出現錯誤python: can't open file '/code/manage.py': [Errno 2] No such file or directory

至於 localhost,我應該在某處使用network_mode: host參數嗎?

哦,最終...我看過 Bret Fisher 的視頻,他說不可能從 \User\USERNAME 以外的目錄運行項目

一旦我將它復制到那里(請注意....可能有很多,您應該將其復制到您當前登錄的用戶目錄中,前提是您是管理員,如果不將項目復制到管理員目錄。我的計算機是域的一部分,因此后者是我的情況。

唯一我還沒有解決的問題......是如何在本地主機上運行 web 服務器......它只會在http0: 801 處打開一個 web 頁面。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM