当前位置: 首页 > 知识库问答 >
问题:

:启动容器进程导致“exec:\“sudo\”:未找到可执行文件

鲜于凯康
2023-03-14

错误:无法启动服务cpanel_客户端:头字段值无效“oci运行时错误:容器_linux.go:247:启动容器进程导致”exec:\“sudo\”:未找到可执行文件

这是我的docker文件,

FROM node:8.1.2-alpine

WORKDIR /control-panel
COPY package.json /control-panel/package.json
RUN npm install auth0-lock mapbox-gl mapbox-gl-geocoder tinymce angular2-jwt aws-sdk @angular/cli hammerjs jquery moment moment-timezone bootstrap@3 jquery-ui-dist --save
RUN mv /control-panel/node_modules /node_modules
COPY . /control-panel
EXPOSE 4200
EXPOSE 49153

这是码头工人。yml,

cpanel_client:
    build: .
    ports:
        - "4200:4200"
        - "49153:49153"
    volumes:
        - .:/control-panel
    command: npm start

我的package.json档案,

{
  "name": "cpanelcli",
  "version": "0.0.0",
  "license": "MIT",
  "angular-cli": {},
  "scripts": {
    "ng": "ng",
    "start": "ng serve --host 0.0.0.0",
    "lint": "tslint \"src/**/*.ts\"",
    "test": "ng test",
    "pree2e": "webdriver-manager update --standalone false --gecko false",
    "e2e": "protractor"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "4.0.0",
    "@angular/compiler": "4.0.0",
    "@angular/core": "4.0.0",
    "@angular/forms": "4.0.0",
    "@angular/http": "4.0.0",
    "@angular/material": "^2.0.0-beta.2",
    "@angular/platform-browser": "4.0.0",
    "@angular/platform-browser-dynamic": "4.0.0",
    "@angular/router": "^3.3.1",
    "@types/jquery": "^2.0.46",
    "angular2-jwt": "^0.1.28",
    "aws-sdk": "^2.28.0",
    "bootstrap": "^3.3.7",
    "core-js": "^2.4.1",
    "hammerjs": "^2.0.8",
    "jquery": "^3.2.1",
    "jquery-ui-dist": "^1.12.1",
    "mapbox-gl": "^0.34.0",
    "mapbox-gl-geocoder": "^2.0.1",
    "mapbox.js": "^3.0.1",
    "ng2-datepicker": "^1.8.0",
    "rxjs": "^5.0.1",
    "tinymce": "^4.5.5",
    "ts-helpers": "^1.1.1",
    "zone.js": "^0.7.2"
  },
  "devDependencies": {
    "@angular/compiler-cli": "^2.3.1",
    "@types/jasmine": "2.5.38",
    "@types/node": "^6.0.42",
    "angular-cli": "1.0.0-beta.24",
    "codelyzer": "~2.0.0-beta.1",
    "jasmine-core": "2.5.2",
    "jasmine-spec-reporter": "2.5.0",
    "karma": "1.2.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-remap-istanbul": "^0.2.1",
    "protractor": "~4.0.13",
    "ts-node": "1.2.1",
    "tslint": "^4.0.2",
    "typescript": "~2.0.3"
  }
}

建造成功了。当我运行docker compose run–rm cpanel_client ng init–skip npm–name CliDemo时,我遇到了这个错误。有人能告诉我哪里错了吗?

共有2个答案

皮自明
2023-03-14

您的图像上似乎没有安装sudo。请注意错误消息

"exec: \"sudo\": executable file not found

有东西正在尝试sudo(“超级用户做”)一件事,但无法。请尝试通过软件包管理器安装sudo,以平息该步骤,或尝试将该步骤配置为不需要超级用户权限。

花烨
2023-03-14

node_modules/。默认情况下,bin文件夹不在$PATH中。您只需直接调用路径:

command: /control-panel/node_modules/.bin/ng serve --host 0.0.0.0
 类似资料: