- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
每次当我尝试在 devcontainer 中打开我的代码时,我都会收到此错误:
[2020-04-12T17:35:08.489Z] [PID 4968] [22748 ms] Start: Run: docker ps -q -a --filter label=com.docker.compose.project=nodejs-express-jwt_devcontainer --filter label=com.docker.compose.service=api [2020-04-12T17:35:08.591Z] [PID 4968] [22850 ms] Start: Run: docker inspect --type container ad270338d286 [2020-04-12T17:35:10.986Z] [PID 4968] [25245 ms] Start: Inspecting container [2020-04-12T17:35:10.986Z] [PID 4968] [25245 ms] Start: Run: docker inspect --type container ad270338d286ba6db0560a94fd7a826bb563f17299799bfc1b8488becea02091 [2020-04-12T17:35:14.884Z] [PID 4968] [29143 ms] Start: Run: docker exec -i -u node -e VSCODE_REMOTE_CONTAINERS_SESSION=6351885a-14c9-4520-8ac6-db1d1e4218231586712884962 ad270338d286ba6db0560a94fd7a826bb563f17299799bfc1b8488becea02091 /bin/sh [2020-04-12T17:35:14.899Z] [PID 4968] [29158 ms] Start: Run in container: uname -m [2020-04-12T17:35:27.282Z] [PID 4968] [41541 ms] Start: Run in container: cat /etc/passwd [2020-04-12T17:35:27.282Z] [PID 4968] [41541 ms] Stdin closed! [2020-04-12T17:35:27.285Z] [PID 4968] [41544 ms] Shell server terminated (code: 1, signal: null) No such exec instance: 43330c7272221ead535677993be73423b5f6bdb8497429ee7380a81bb43bce59
FROM node:12.16-alpine
#Linux setup
RUN apk update \
&& apk add --update alpine-sdk \
&& apk add --no-cache git \
&& apk add --no-cache npm \
&& npm cache verify
# && sed -i -e "s/bin\/ash/bin\/sh/" /etc/passwd
RUN git config --global user.email "my@email.com" \
&& git config --global user.name "My Name"
version: '3.3'
services:
api:
build: .
restart: always
depends_on:
- db
ports:
- 3000:80
environment:
DB_HOST: db
DB_USER: apiuser
DB_PASSWORD: apipass
DB_NAME: apidb
# volumes:
# - ./src:/var/www/html/wp-content/plugins/meu-plugin
db:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: apidb
MYSQL_USER: apiuser
MYSQL_PASSWORD: apipass
MYSQL_RANDOM_ROOT_PASSWORD: '1'
volumes:
- db:/var/lib/mysql
adminer:
depends_on:
- db
image: adminer
restart: always
ports:
- 8888:8080
networks:
back:
volumes:
db:
{
"name": "Node.js",
// "dockerFile": "Dockerfile",
"service": "api",
"dockerComposeFile": "docker-compose.yml",
// Use 'appPort' to create a container with published ports. If the port isn't working, be sure
// your server accepts connections from all interfaces (0.0.0.0 or '*'), not just localhost.
"appPort": [3000],
// Comment out the next line to run as root instead.
"remoteUser": "node",
// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"terminal.integrated.shell.linux": "/bin/sh"
},
// Specifies a command that should be run after the container has been created.
// "postCreateCommand": "yarn install",
// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": [
"dbaeumer.vscode-eslint"
]
}
最佳答案
我认为问题可能是您的 api 容器在运行 git config 命令后终止。您是否尝试添加
command: sleep infinity
到您的
docker-compose.yml
中的 api 服务?
关于Docker VS 代码移除 devcontainer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61175598/
我正在做一个项目,我的 android 在这个项目中作为一个网络服务器工作;输入带端口号的 IP 地址,打开 Web 界面,用户可以将文件上传到手机。我想在 Web 界面上显示一些图片,以便我们的界面
我是一名优秀的程序员,十分优秀!