0

I want to generate the Dockerfile from a official Dockerhub image namely the influxDB

After trying the suggested method on

$ 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  

I get the error message

/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>'

Therefore how can I generate the Dockerfile from the aforementioned image.

A.Dumas
  • 2,619
  • 3
  • 28
  • 51
  • Do it does not since I tried the solution and it returns the above error message – A.Dumas Jan 14 '20 at 09:32
  • Your error message lets me think that you haven't used hub.docker.com/r/chenzj/dfimage for this, as explained in the linked answer – Nico Haase Jan 14 '20 at 09:37
  • 5
    in this context, why don't you simply get the [dockerfile from the official repo](https://github.com/influxdata/influxdata-docker/blob/d80e739adbe01bb2f0cb3db77da3ded6c1556d15/influxdb/1.7/Dockerfile) ? – Zeitounator Jan 14 '20 at 09:40

1 Answers1

0

Using the "Tags" tab, you can see all build runs of that image, and this includes a list of all steps taken. Copy all of them together, and you receive the Dockerfile used to build a specific tag

Nico Haase
  • 11,420
  • 35
  • 43
  • 69