Docker, VS Code, Dev Containers 和 httpd: localhost: 无休止加载中

huangapple go评论60阅读模式
英文:

Docker, VS Code, Dev Containers & httpd: localhost:<port_number> loading endlessly

问题

无法在 Dev Containers 上运行 httpd。本地主机:<port_number> 无限加载。

重现步骤:

要求

  • Docker(CLI)
  • Docker httpd 镜像
  • VS Code
  • Dev Containers VS Code 扩展

目录结构:

src/index.html
.devcontainer.json
compose.yml
Dockerfile

.devcontainer.json

{
  "dockerComposeFile": "compose.yml",
  "features": {
    "ghcr.io/devcontainers/features/common-utils:2": {
      "uid": "1001",
      "gid": "1001"
    }
  },
  "forwardPorts": [80],
  "name": "Foo App",
  "service": "httpd",
  "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}"
}

compose.yml

services:
  httpd:
    build: .
    command: sleep infinity
    user: foo
    volumes:
      - ../:/workspaces:cached
      - ./src/:/usr/local/apache2/htdocs/

Dockerfile

FROM httpd:2.4

RUN apt-get update \
    && export DEBIAN_FRONTEND=noninteractive \
    && apt-get install -y git \
    && apt-get clean -y \
    && rm -rf /var/lib/apt/lists/*

Dev Container 端口列表
80 到本地主机:&lt;port_number&gt;

实际结果:
本地主机:<port_number> 无限加载

预期结果:
本地主机:<port_number> 加载 index.html

请提供指导。谢谢!

英文:

Unable to run httpd on Dev Containers. Localhost:<port_number> loads endlessly.

Steps to reproduce:

requirement

  • Docker (CLI)
  • Docker httpd image
  • VS Code
  • Dev Containers VS Code extension

directory structure:

src/index.html
.devcontainer.json
compose.yml
Dockerfile

.devcontainer.json

{
  &quot;dockerComposeFile&quot;: &quot;compose.yml&quot;,
  &quot;features&quot;: {
    &quot;ghcr.io/devcontainers/features/common-utils:2&quot;: {
      &quot;uid&quot;: &quot;1001&quot;,
      &quot;gid&quot;: &quot;1001&quot;
    }
  },
  &quot;forwardPorts&quot;: [80],
  &quot;name&quot;: &quot;Foo App&quot;,
  &quot;service&quot;: &quot;httpd&quot;,
  &quot;workspaceFolder&quot;: &quot;/workspaces/${localWorkspaceFolderBasename}&quot;
}

compose.yml

services:
  httpd:
    build: .
    command: sleep infinity
    user: foo
    volumes:
      - ../:/workspaces:cached
      - ./src/:/usr/local/apache2/htdocs/

Dockerfile

FROM httpd:2.4

RUN apt-get update \
    &amp;&amp; export DEBIAN_FRONTEND=noninteractive \
    &amp;&amp; apt-get install -y git \
    &amp;&amp; apt-get clean -y \
    &amp;&amp; rm -rf /var/lib/apt/lists/*

Dev Container ports list
80 to localhost:&lt;port_number&gt;

Actual results:
localhost:<port_number> loading endlessly

Expected results:
localhost:<port_number> load the index.html

Directions please. Thank You!

The logs

[90995 ms] Start: Run: docker inspect --type image httpd-httpd
[91202 ms] Start: Run: docker build -f /tmp/devcontainercli-webdev/updateUID.Dockerfile-0.42.0 -t vsc-httpd-3e5a7594542124ebbd98ae3598ec20664e5960be38ee2795d19ecc2a42be4bf8-uid --build-arg BASE_IMAGE=httpd-httpd --build-arg REMOTE_USER=foo --build-arg NEW_UID=1000 --build-arg NEW_GID=1000 --build-arg IMAGE_USER=root /home/webdev/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/empty-folder
[+] Building 0.9s (6/6) FINISHED                                                
=&gt; [internal] load build definition from updateUID.Dockerfile-0.42.0      0.0s
=&gt; =&gt; transferring dockerfile: 1.33kB                                     0.0s
=&gt; [internal] load .dockerignore                                          0.0s
=&gt; =&gt; transferring context: 2B                                            0.0s
=&gt; [internal] load metadata for docker.io/library/httpd-httpd:latest      0.0s
=&gt; [1/2] FROM docker.io/library/httpd-httpd                               0.2s
=&gt; [2/2] RUN eval $(sed -n &quot;s/foo:[^:]*:\([^:]*\):\([^:]*\):[^:]*:\([^:]  0.4s
=&gt; exporting to image                                                     0.1s
=&gt; =&gt; exporting layers                                                    0.1s
=&gt; =&gt; writing image sha256:f8cff4aa3e9aa02b7cdbb497ed9cd00b40218c5f6eeae  0.0s
=&gt; =&gt; naming to docker.io/library/vsc-httpd-3e5a7594542124ebbd98ae3598ec  0.0s
[92331 ms] Docker Compose override file for creating container:
services:
&#39;httpd&#39;:
image: vsc-httpd-3e5a7594542124ebbd98ae3598ec20664e5960be38ee2795d19ecc2a42be4bf8-uid
entrypoint: [&quot;/bin/sh&quot;, &quot;-c&quot;, &quot;echo Container started\n
trap \&quot;exit 0\&quot; 15\n
\n
exec \&quot;$$@\&quot;\n
while sleep 1 &amp; wait $$!; do :; done&quot;, &quot;-&quot;]
labels:
- &#39;devcontainer.local_folder=/home/webdev/Documents/docker/httpd&#39;
- &#39;devcontainer.config_file=/home/webdev/Documents/docker/httpd/.devcontainer.json&#39;
volumes:
- vscode:/vscode
- /run/user/1000/wayland-0:/tmp/vscode-wayland-9a56d2de-855f-43ef-ab9c-31754e4dca9f.sock
volumes:
vscode:
external: true
[92331 ms] Writing docker-compose.devcontainer.containerFeatures-1688371347340.yml to /home/webdev/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/docker-compose
[92332 ms] Start: Run: docker compose --project-name httpd -f /home/webdev/Documents/docker/httpd/compose.yml -f /home/webdev/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/docker-compose/docker-compose.devcontainer.build-1688371265346.yml -f /home/webdev/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/docker-compose/docker-compose.devcontainer.containerFeatures-1688371347340.yml up -d
[+] Building 0.0s (0/0)                                                         
[+] Running 2/2
✔ Network httpd_default    Created                                        0.1s 
✔ Container httpd-httpd-1  Started                                        0.5s 
[93090 ms] Start: Run: docker ps -q -a --filter label=com.docker.compose.project=httpd --filter label=com.docker.compose.service=httpd
[93124 ms] Start: Run: docker inspect --type container e4677a7e37d5
[93148 ms] Start: Inspecting container
[93148 ms] Start: Run: docker inspect --type container e4677a7e37d57384ef976083b56655fc703ca1055462a5c2a71558bee2eba8a0
[93181 ms] Start: Run in container: /bin/sh
[93187 ms] Start: Run in container: uname -m
[93317 ms] x86_64
[93317 ms] 
[93317 ms] Start: Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2&gt;/dev/null
[93321 ms] PRETTY_NAME=&quot;Debian GNU/Linux 12 (bookworm)&quot;
NAME=&quot;Debian GNU/Linux&quot;
VERSION_ID=&quot;12&quot;
VERSION=&quot;12 (bookworm)&quot;
VERSION_CODENAME=bookworm
ID=debian
HOME_URL=&quot;https://www.debian.org/&quot;
SUPPORT_URL=&quot;https://www.debian.org/support&quot;
BUG_REPORT_URL=&quot;https://bugs.debian.org/&quot;
[93321 ms] 
[93322 ms] Start: Run in container: cat /etc/passwd
[93323 ms] Start: Run in container: test -f &#39;/var/devcontainer/.patchEtcEnvironmentMarker&#39;
[93327 ms] 
[93327 ms] 
[93327 ms] Exit code 1
[93328 ms] Start: Run in container: /bin/sh
[93332 ms] Start: Run in container: test ! -f &#39;/var/devcontainer/.patchEtcEnvironmentMarker&#39; &amp;&amp; set -o noclobber &amp;&amp; mkdir -p &#39;/var/devcontainer&#39; &amp;&amp; { &gt; &#39;/var/devcontainer/.patchEtcEnvironmentMarker&#39; ; } 2&gt; /dev/null
[93432 ms] 
[93432 ms] 
[93432 ms] Start: Run in container: cat &gt;&gt; /etc/environment &lt;&lt;&#39;etcEnvrionmentEOF&#39;
[93439 ms] 
[93439 ms] 
[93439 ms] Start: Run in container: test -f &#39;/var/devcontainer/.patchEtcProfileMarker&#39;
[93442 ms] 
[93442 ms] 
[93442 ms] Exit code 1
[93442 ms] Start: Run in container: test ! -f &#39;/var/devcontainer/.patchEtcProfileMarker&#39; &amp;&amp; set -o noclobber &amp;&amp; mkdir -p &#39;/var/devcontainer&#39; &amp;&amp; { &gt; &#39;/var/devcontainer/.patchEtcProfileMarker&#39; ; } 2&gt; /dev/null
[93447 ms] 
[93447 ms] 
[93447 ms] Start: Run in container: sed -i -E &#39;s/((^|\s)PATH=)([^\$]*)$/\1${PATH:-\3}/g&#39; /etc/profile || true
[93452 ms] 
[93452 ms] 
[93463 ms] Start: Run: docker inspect --type container e4677a7e37d57384ef976083b56655fc703ca1055462a5c2a71558bee2eba8a0
[93526 ms] Start: Run: docker exec -i -u root e4677a7e37d57384ef976083b56655fc703ca1055462a5c2a71558bee2eba8a0 /bin/sh -c echo &quot;New container started. Keep-alive process started.&quot; ; export VSCODE_REMOTE_CONTAINERS_SESSION=0632a7e5-e44a-4e67-a8de-8a7eb8fa84481688371254018 ; /bin/sh
[93531 ms] Start: Run: docker-compose version --short
[93536 ms] Start: Run: docker compose version --short
[93641 ms] New container started. Keep-alive process started.
[93698 ms] Start: Run: /snap/code/132/usr/share/code/code --ms-enable-electron-run-as-node /home/webdev/.vscode/extensions/ms-vscode-remote.remote-containers-0.295.0/dist/spec-node/devContainersSpecCLI.js read-configuration --workspace-folder /home/webdev/Documents/docker/httpd --id-label devcontainer.local_folder=/home/webdev/Documents/docker/httpd --id-label devcontainer.config_file=/home/webdev/Documents/docker/httpd/.devcontainer.json --container-id e4677a7e37d57384ef976083b56655fc703ca1055462a5c2a71558bee2eba8a0 --log-level debug --log-format json --config /home/webdev/Documents/docker/httpd/.devcontainer.json --include-merged-configuration --mount-workspace-git-root true
[94035 ms] @devcontainers/cli 0.42.0. Node.js v16.17.1. linux 5.15.0-76-generic x64.
[94035 ms] Start: Run: docker inspect --type container e4677a7e37d57384ef976083b56655fc703ca1055462a5c2a71558bee2eba8a0
[94090 ms] Start: Inspecting container
[94090 ms] Start: Run: docker inspect --type container e4677a7e37d57384ef976083b56655fc703ca1055462a5c2a71558bee2eba8a0
[94119 ms] Start: Run in container: /bin/sh
[94128 ms] Start: Run in container: uname -m
[94238 ms] x86_64
[94239 ms] 
[94239 ms] Start: Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2&gt;/dev/null
[94245 ms] PRETTY_NAME=&quot;Debian GNU/Linux 12 (bookworm)&quot;
NAME=&quot;Debian GNU/Linux&quot;
VERSION_ID=&quot;12&quot;
VERSION=&quot;12 (bookworm)&quot;
VERSION_CODENAME=bookworm
ID=debian
HOME_URL=&quot;https://www.debian.org/&quot;
SUPPORT_URL=&quot;https://www.debian.org/support&quot;
BUG_REPORT_URL=&quot;https://bugs.debian.org/&quot;
[94246 ms] 
[94248 ms] Start: Run in container: cat /etc/passwd
[94251 ms] Start: Updating configuration state
[94278 ms] Start: Setup shutdown monitor
[94281 ms] Forking shutdown monitor: /home/webdev/.vscode/extensions/ms-vscode-remote.remote-containers-0.295.0/dist/shutdown/shutdownMonitorProcess /run/user/1000/vscode-remote-containers-d487caaa-21d7-46ea-87d7-7a7909c8a43d.sock dockerCompose Debug /home/webdev/.config/Code/logs/20230703T101217/window1/exthost/ms-vscode-remote.remote-containers 1688371255009
[94285 ms] Start: Run in container: test -d /home/foo/.vscode-server
[94286 ms] 
[94286 ms] 
[94286 ms] Exit code 1
[94287 ms] Start: Run in container: test -d /home/foo/.vscode-remote
[94289 ms] 
[94289 ms] 
[94289 ms] Exit code 1
[94289 ms] Start: Run in container: test ! -f &#39;/home/foo/.vscode-server/data/Machine/.writeMachineSettingsMarker&#39; &amp;&amp; set -o noclobber &amp;&amp; mkdir -p &#39;/home/foo/.vscode-server/data/Machine&#39; &amp;&amp; { &gt; &#39;/home/foo/.vscode-server/data/Machine/.writeMachineSettingsMarker&#39; ; } 2&gt; /dev/null
[94294 ms] 
[94295 ms] 
[94295 ms] Start: Run in container: cat /home/foo/.vscode-server/data/Machine/settings.json
[94300 ms] 
[94300 ms] cat: /home/foo/.vscode-server/data/Machine/settings.json: No such file or directory
[94301 ms] Exit code 1
[94301 ms] Start: Run in container: test -d /home/foo/.vscode-server/bin/695af097c7bd098fbf017ce3ac85e09bbc5dda06
[94311 ms] 
[94311 ms] 
[94311 ms] Exit code 1
[94311 ms] Start: Run in container: test -d /vscode/vscode-server/bin/linux-x64/695af097c7bd098fbf017ce3ac85e09bbc5dda06
[94314 ms] 
[94314 ms] 
[94314 ms] Start: Run in container: mkdir -p &#39;/home/foo/.vscode-server/bin&#39; &amp;&amp; ln -snf &#39;/vscode/vscode-server/bin/linux-x64/695af097c7bd098fbf017ce3ac85e09bbc5dda06&#39; &#39;/home/foo/.vscode-server/bin/695af097c7bd098fbf017ce3ac85e09bbc5dda06&#39;
[94319 ms] 
[94319 ms] 
[94320 ms] Start: Run in container: /bin/sh
[94336 ms] Start: Launching Dev Containers helper.
[94337 ms] ssh-agent: SSH_AUTH_SOCK in container (/tmp/vscode-ssh-auth-0da0db22-18b8-4d5a-9902-ecfc0576b34a.sock) forwarded to local host (/run/user/1000/keyring/ssh).
[94338 ms] Start: Run in container: test -e /tmp/.X11-unix/X0
[94338 ms] Start: Run in container: touch &#39;/vscode/vscode-server/bin/linux-x64/695af097c7bd098fbf017ce3ac85e09bbc5dda06&#39;
[94345 ms] 
[94345 ms] 
[94345 ms] Exit code 1
[94345 ms] Start: Run in container: mkdir -p &#39;/tmp/.X11-unix&#39;
[94347 ms] 
[94348 ms] 
[94348 ms] X11 forwarding: DISPLAY in container (:0) forwarded to local host (:0).
[94348 ms] Start: Run in container: gpgconf --list-dir agent-socket
[94350 ms] /home/foo/.gnupg/S.gpg-agent
[94351 ms] 
[94351 ms] Start: Run in container: gpgconf --list-dir homedir
[94353 ms] /home/foo/.gnupg
[94353 ms] 
[94353 ms] Start: Run in container: ls &#39;/home/foo/.gnupg/private-keys-v1.d&#39; 2&gt;/dev/null
[94359 ms] 
[94359 ms] 
[94360 ms] Exit code 2
[94360 ms] Start: Run: gpgconf --list-dir agent-extra-socket
[94398 ms] /run/user/1000/gnupg/S.gpg-agent.extra
[94399 ms] 
[94399 ms] Start: Run in container: mkdir -p -m 700 &#39;/home/foo/.gnupg&#39;
[94399 ms] gpg-agent: Socket in container (/home/foo/.gnupg/S.gpg-agent) forwarded to local host (/run/user/1000/gnupg/S.gpg-agent.extra).
[94440 ms] 
[94440 ms] 
[94441 ms] Start: Run in container: command -v docker &gt;/dev/null 2&gt;&amp;1
[94441 ms] Start: Run: gpgconf --list-dir homedir
[94470 ms] 
[94470 ms] 
[94470 ms] Exit code 127
[94471 ms] Start: Run in container: /bin/sh
[94503 ms] userEnvProbe: loginInteractiveShell (default)
[94504 ms] Start: Run in container: test -f &#39;/tmp/devcontainers-0632a7e5-e44a-4e67-a8de-8a7eb8fa84481688371254018/env-loginInteractiveShell.json&#39;
[94504 ms] Start: Run in container: echo ~
[94506 ms] 
[94506 ms] 
[94507 ms] Start: Run in container: command -v git &gt;/dev/null 2&gt;&amp;1 &amp;&amp; git config --system --replace-all credential.helper &#39;!f() { /home/foo/.vscode-server/bin/695af097c7bd098fbf017ce3ac85e09bbc5dda06/node /tmp/vscode-remote-containers-0da0db22-18b8-4d5a-9902-ecfc0576b34a.js git-credential-helper $*; }; f&#39; || true
[94507 ms] 
[94507 ms] 
[94508 ms] Exit code 1
[94508 ms] userEnvProbe: not found in cache
[94508 ms] userEnvProbe shell: /bin/bash
[94509 ms] /home/webdev/.gnupg
[94509 ms] 
[94509 ms] Start: Run in container: gpgconf --list-dir homedir
[94512 ms] 
[94512 ms] 
[94516 ms] /home/foo/.gnupg
[94517 ms] 
[94517 ms] Start: Run in container: for pid in `cd /proc &amp;&amp; ls -d [0-9]*`; do { echo $pid ; readlink /proc/$pid/cwd || echo ; readlink /proc/$pid/ns/mnt || echo ; cat /proc/$pid/stat | tr &quot;
[94635 ms] Start: Run in container: # Test for /home/foo/.gnupg/pubring.kbx and gpg
[94638 ms] 
[94638 ms] 
[94638 ms] Start: Run in container: cat &#39;/home/foo/.vscode-server/bin/695af097c7bd098fbf017ce3ac85e09bbc5dda06/product.json&#39;
[94642 ms] Start: Run in container: # Copy /home/webdev/.gnupg/pubring.kbx to /home/foo/.gnupg/pubring.kbx
[94646 ms] 
[94646 ms] 
[94646 ms] Start: Run in container: cat &#39;/home/foo/.vscode-server/data/Machine/.connection-token-695af097c7bd098fbf017ce3ac85e09bbc5dda06&#39; 2&gt;/dev/null || (umask 377 &amp;&amp; echo &#39;59482ae2-dfcf-4460-8496-a8becdcfecf1&#39; &gt;&#39;/home/foo/.vscode-server/data/Machine/.connection-token-695af097c7bd098fbf017ce3ac85e09bbc5dda06-c65b978d-08cf-440f-94e0-a8e496ed467e&#39; &amp;&amp; mv -n &#39;/home/foo/.vscode-server/data/Machine/.connection-token-695af097c7bd098fbf017ce3ac85e09bbc5dda06-c65b978d-08cf-440f-94e0-a8e496ed467e&#39; &#39;/home/foo/.vscode-server/data/Machine/.connection-token-695af097c7bd098fbf017ce3ac85e09bbc5dda06&#39; &amp;&amp; rm -f &#39;/home/foo/.vscode-server/data/Machine/.connection-token-695af097c7bd098fbf017ce3ac85e09bbc5dda06-c65b978d-08cf-440f-94e0-a8e496ed467e&#39; &amp;&amp; cat &#39;/home/foo/.vscode-server/data/Machine/.connection-token-695af097c7bd098fbf017ce3ac85e09bbc5dda06&#39;)
[94654 ms] 59482ae2-dfcf-4460-8496-a8becdcfecf1
[94654 ms] 
[94654 ms] Start: Run in container: # Test for /home/foo/.gnupg/trustdb.gpg and gpg
[94655 ms] Start: Starting VS Code Server
[94655 ms] Start: Preparing Extensions
[94660 ms] /home/foo
[94661 ms] 
[94661 ms] Start: Run in container: cat &lt;&lt;&#39;EOF-/tmp/vscode-remote-containers-0da0db22-18b8-4d5a-9902-ecfc0576b34a.js&#39; &gt;/tmp/vscode-remote-containers-0da0db22-18b8-4d5a-9902-ecfc0576b34a.js
[94661 ms] 
[94661 ms] 
[94662 ms] Start: Run in container: test ! -f &#39;/home/foo/.vscode-server/data/Machine/.installExtensionsMarker&#39; &amp;&amp; set -o noclobber &amp;&amp; mkdir -p &#39;/home/foo/.vscode-server/data/Machine&#39; &amp;&amp; { &gt; &#39;/home/foo/.vscode-server/data/Machine/.installExtensionsMarker&#39; ; } 2&gt; /dev/null
[94664 ms] 
[94664 ms] 
[94665 ms] Start: Run in container: # Copy /home/webdev/.gnupg/trustdb.gpg to /home/foo/.gnupg/trustdb.gpg
[94672 ms] Extensions cache, install extensions: None
[94673 ms] 
[94673 ms] 
[94673 ms] Start: Run in container: cat &lt;&lt;&#39;EOF-/tmp/vscode-remote-containers-server-0da0db22-18b8-4d5a-9902-ecfc0576b34a.js&#39; &gt;/tmp/vscode-remote-containers-server-0da0db22-18b8-4d5a-9902-ecfc0576b34a.js_1688371349682
[94676 ms] 
[94677 ms] 
[94690 ms] 
[94690 ms] 
[94690 ms] Start: Run in container: test -d /home/foo/.vscode-server/extensionsCache &amp;&amp; ls /home/foo/.vscode-server/extensionsCache || true
[94691 ms] Start: Run: gpg-connect-agent updatestartuptty /bye
[94704 ms] 
[94704 ms] 
[94705 ms] Start: Run in container: test -d /vscode/vscode-server/extensionsCache &amp;&amp; ls /vscode/vscode-server/extensionsCache || true
[94710 ms] dbaeumer.vscode-eslint-2.4.2
[94710 ms] 
[94711 ms] Extensions cache, link in container: None
[94712 ms] Optimizing extensions for quality: stable
[94713 ms] Start: Run in container: /home/foo/.vscode-server/bin/695af097c7bd098fbf017ce3ac85e09bbc5dda06/bin/code-server --log debug --force-disable-user-env --server-data-dir /home/foo/.vscode-server --use-host-proxy --telemetry-level all --accept-server-license-terms --host 127.0.0.1 --port 0 --connection-token-file /home/foo/.vscode-server/data/Machine/.connection-token-695af097c7bd098fbf017ce3ac85e09bbc5dda06 --extensions-download-dir /home/foo/.vscode-server/extensionsCache --start-server --disable-websocket-compression
[94895 ms] *
* Visual Studio Code Server
*
* By using the software, you agree to
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
*
[94899 ms] Server bound to 127.0.0.1:43143 (IPv4)
Extension host agent listening on 43143
[94899 ms] Start: Run in container: echo 43143 &gt;&#39;/home/foo/.vscode-server/data/Machine/.devport-695af097c7bd098fbf017ce3ac85e09bbc5dda06&#39;
[94901 ms] 
[94901 ms] 
[94902 ms] Port forwarding for container port 43143 starts listening on local port.
[94902 ms] Port forwarding local port 43143 to container port 43143
[94903 ms] Start: Run in container: # Test for /home/foo/.gitconfig and git
[94910 ms] 
[94910 ms] 
[94911 ms] Start: Run in container: # Copy /home/webdev/.gitconfig to /home/foo/.gitconfig
[94921 ms] 
[94921 ms] 
[94922 ms] Start: Run in container: command -v git &gt;/dev/null 2&gt;&amp;1 &amp;&amp; git config --global --replace-all credential.helper &#39;!f() { /home/foo/.vscode-server/bin/695af097c7bd098fbf017ce3ac85e09bbc5dda06/node /tmp/vscode-remote-containers-0da0db22-18b8-4d5a-9902-ecfc0576b34a.js git-credential-helper $*; }; f&#39; || true
[94929 ms] 
[94930 ms] 
[94977 ms] userEnvProbe PATHs:
Probe:     &#39;/usr/local/apache2/bin:/usr/local/apache2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/foo/.local/bin&#39;
Container: &#39;/usr/local/apache2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&#39;
[94977 ms] Start: Run in container: mkdir -p &#39;/tmp/devcontainers-0632a7e5-e44a-4e67-a8de-8a7eb8fa84481688371254018&#39; &amp;&amp; cat &gt; &#39;/tmp/devcontainers-0632a7e5-e44a-4e67-a8de-8a7eb8fa84481688371254018/env-loginInteractiveShell.json&#39; &lt;&lt; &#39;envJSON&#39;
[95000 ms] 
[95001 ms] 
[95001 ms] Start: Run in container: umask 077 &amp;&amp; XRD=&quot;/tmp/user/$(id -u)&quot; &amp;&amp; mkdir -p $XRD &amp;&amp; echo $XRD
[95006 ms] /tmp/user/1000
[95006 ms] 
[95006 ms] Start: Run in container: test -e /tmp/user/1000/vscode-wayland-9a56d2de-855f-43ef-ab9c-31754e4dca9f.sock || ln -sf /tmp/vscode-wayland-9a56d2de-855f-43ef-ab9c-31754e4dca9f.sock /tmp/user/1000/vscode-wayland-9a56d2de-855f-43ef-ab9c-31754e4dca9f.sock
[95010 ms] 
[95010 ms] 
[95138 ms] Port forwarding connection from 38592 &gt; 43143 &gt; 43143 in the container.
[95139 ms] Start: Run in container: /home/foo/.vscode-server/bin/695af097c7bd098fbf017ce3ac85e09bbc5dda06/node -e 
[95286 ms] [08:02:30] 
[95332 ms] Port forwarding 38592 &gt; 43143 &gt; 43143 stderr: Connection established
[95339 ms] [08:02:30] Extension host agent started.
[95423 ms] [08:02:30] No uninstalled extensions found.
[95437 ms] [08:02:30] Started initializing default profile extensions in extensions installation folder. file:///home/foo/.vscode-server/extensions
[95440 ms] Port forwarding connection from 38616 &gt; 43143 &gt; 43143 in the container.
[95440 ms] Start: Run in container: /home/foo/.vscode-server/bin/695af097c7bd098fbf017ce3ac85e09bbc5dda06/node -e 
[95457 ms] [08:02:30] ComputeTargetPlatform: linux-x64
[95485 ms] [08:02:30] Completed initializing default profile extensions in extensions installation folder. file:///home/foo/.vscode-server/extensions
[95621 ms] [08:02:30] [127.0.0.1][5e005c57][ManagementConnection] New connection established.
[95631 ms] Port forwarding 38616 &gt; 43143 &gt; 43143 stderr: Connection established
[95685 ms] [08:02:30] Log level changed to info
[95853 ms] [08:02:30] [127.0.0.1][1b08e55e][ExtensionHostConnection] New connection established.
[95905 ms] [08:02:30] [127.0.0.1][1b08e55e][ExtensionHostConnection] &lt;277&gt; Launched Extension Host Process.
[111546 ms] Port forwarding connection from 41460 &gt; 43143 &gt; 43143 in the container.
[111551 ms] Start: Run in container: /home/foo/.vscode-server/bin/695af097c7bd098fbf017ce3ac85e09bbc5dda06/node -e 
[111799 ms] Port forwarding 41460 &gt; 43143 &gt; 43143 stderr: Connection established

答案1

得分: 0

我最终成功地让它工作了。以下是步骤(按顺序):

  1. 将common-utils:2留空
  2. 删除name
  3. 添加remoteUser
  4. 删除command
  5. 删除user

其余部分保持不变。

英文:

I finally managed to get it working. Here are the steps (in order):

 1. Leave common-utils:2 empty
2. Remove name
3. Add remoteUser
4. Remove command
5. Remove user

Leave the rest as it is.

huangapple
  • 本文由 发表于 2023年7月3日 15:45:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/76602754.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定