user7924031
user7924031

Reputation:

: starting container process caused "exec: \"sudo\": executable file not found

ERROR:Cannot start service cpanel_client: invalid header field value "oci runtime error: container_linux.go:247: starting container process caused "exec: \"sudo\": executable file not found

Here is my docker file,

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

here is the docker compose.yml,

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

my package.json file,

{
  "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"
  }
}

Build was successful. I get this errror when i run docker-compose run –rm cpanel_client ng init –skip-npm –name CliDemo. can someone tell me where am i wrong?

Upvotes: 0

Views: 6417

Answers (2)

Andy Shinn
Andy Shinn

Reputation: 28483

The node_modules/.bin folder is not in $PATH by default. You need to just call the path directly:

command: /control-panel/node_modules/.bin/ng serve --host 0.0.0.0

Upvotes: 2

mattbornski
mattbornski

Reputation: 12543

It appears sudo is not installed on your image. Note the error message:

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

Something is trying to sudo ("super-user do") a thing, and can't. Try installing sudo via the package manager to appease that step, or try configuring that step to not require super user permissions.

Upvotes: 1

Related Questions