【问题标题】:How to generate the Dockerfile from an official image? [duplicate]如何从官方镜像生成 Dockerfile? [复制]
【发布时间】:2020-05-01 00:04:33
【问题描述】:

我想从官方 Dockerhub 镜像生成Dockerfile,即influxDB

在尝试了建议的方法后

$ alias dfimage="docker run -v /var/run/docker.sock:/var/run/docker.sock --rm centurylink/dockerfile-from-image"
$ dfimage --help
$ docker pull influxdb
$ dfimage influxdb  

我收到错误消息

/usr/lib/ruby/gems/2.2.0/gems/docker-api-1.24.1/lib/docker/connection.rb:42:in `rescue in request': 400 Bad Request: malformed Host header (Docker::Error::ClientError)
    from /usr/lib/ruby/gems/2.2.0/gems/docker-api-1.24.1/lib/docker/connection.rb:38:in `request'
    from /usr/lib/ruby/gems/2.2.0/gems/docker-api-1.24.1/lib/docker/connection.rb:65:in `block (2 levels) in <class:Connection>'
    from /usr/lib/ruby/gems/2.2.0/gems/docker-api-1.24.1/lib/docker/image.rb:172:in `all'
    from /usr/src/app/dockerfile-from-image.rb:32:in `<main>'

因此,如何从上述图像生成 Dockerfile。

【问题讨论】:

  • Do it doesn't since I try the solution and it return the above error message
  • 您的错误消息让我认为您没有为此使用 hub.docker.com/r/chenzj/dfimage,如链接答案中所述
  • 在这种情况下,您为什么不简单地获取dockerfile from the official repo

标签: docker dockerfile


【解决方案1】:

使用“标签”选项卡,您可以查看该映像的所有构建运行,其中包括已采取的所有步骤的列表。将它们全部复制在一起,您会收到用于构建特定标签的 Dockerfile

【讨论】:

    猜你喜欢
    • 2019-06-27
    • 1970-01-01
    • 1970-01-01
    • 2013-10-06
    • 2019-08-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多