使用Dockerfile构建映像 - 未知指令

时间:2016-12-05 09:54:00

标签: image powershell docker dockerfile

我正在关注本教程:https://docs.docker.com/engine/tutorials/dockerimages/#building-an-image-from-a-dockerfile

现在我正在启动命令:docker build -t ouruser/sinatra:v2 .

这是输出:enter image description here

我用$null > filename命令创建了Dockerfile,然后用记事本我已经插入了教程建议的代码。

我错过了什么吗?

Dockerfile enter image description here

这是教程中的ctrl + c和ctrl + v。

1 个答案:

答案 0 :(得分:1)

我只是从示例中复制了它,它运行正常,从这里尝试复制,你可能粘贴了一些额外的字符。同时将编码设置为UTF-8。

"name": "my-lib",
  "version": "0.2.1",
  "description": "Shared lib angular2",
  "main": "index.js",
  "typings": "index.d.ts",
  "scripts": {
    "ngc": "ngc",
    "lint": "tslint src/**/*.ts",
    "copyPackage":"node ./scripts/copy-package",
    "build": "rimraf -rf aot dist && npm run ngc && npm run copyPackage",
    "publishPackage": "npm run build && cd dist && npm publish"
  },
  "keywords": [
    "angular",
    "angular2"
  ],
  "author": "Haddar Macdasi",
  "license": "MIT",
  "dependencies": {
    "@angular/core": "2.1.1",
    "@angular/common": "2.1.1",
    "@angular/compiler": "2.1.1",
    "@angular/compiler-cli": "2.1.1",
    "@angular/http":"2.1.1",
    "@angular/platform-browser": "2.1.1",
    "rxjs": "5.0.0-beta.12",
    "angular2-highcharts": "0.4.1",
    "highcharts": "5.0.2"
  },
  "devDependencies": {
    "@types/chai": "^3.4.34",
    "@types/node": "^6.0.41",
    "typescript": "^2.0.3"
  }
正如Mohammed Noureldin所指出的那样,如果不起作用,请尝试修复你的EOL角色。