Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doesn't work with docker 1.10 #14

Open
sokoow opened this issue Apr 20, 2016 · 33 comments
Open

doesn't work with docker 1.10 #14

sokoow opened this issue Apr 20, 2016 · 33 comments

Comments

@sokoow
Copy link

sokoow commented Apr 20, 2016

getting the following when running with docker 1.10:

 docker run -v /var/run/docker.sock:/var/run/docker.sock centurylink/dockerfile-from-image cloudera/quickstart:latest
/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>
@KonstantinCodes
Copy link

not working for 1.11 either

@36web
Copy link

36web commented Aug 2, 2016

not working for 1.12 either

@nelsonenzo
Copy link

is this because --tree was actually depreciated, not just warned?

@dduvnjak
Copy link

The issue is caused by the excon gem (which is a dependency of docker-api). Upgrading excon to latest version (v0.51) should fix it. Rebuilding the image should have the same effect.

@ylavoie
Copy link

ylavoie commented Aug 15, 2016

Neither did

@dduvnjak
Copy link

@ylavoie: It worked on my side. All I did was rebuild the image. If you tried building it before, did you do it with --no-cache last time?
If rebuild was successful, you should have seen this message in the output: Successfully installed excon-0.51.0

This is my rebuild without any modifications that works: https://hub.docker.com/r/dduvnjak/dockerfile-from-image/

@AnthonyWC
Copy link

Looks like still broken:

antho@alto:~/docker$ docker version
Client:
 Version:      1.12.3
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   6b644ec
 Built:        Wed Oct 26 22:01:48 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.12.3
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   6b644ec
 Built:        Wed Oct 26 22:01:48 2016
 OS/Arch:      linux/amd64

antho@alto:~/docker$ docker run --rm -v /run/docker.sock:/run/docker.sock dduvnjak/dockerfile-from-image ruby
/usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/unix_socket.rb:14:in `connect_nonblock': No such file or directory - connect(2) for /var/run/docker.sock (Errno::ENOENT) (Excon::Error::Socket)
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/unix_socket.rb:14:in `connect'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/socket.rb:28:in `initialize'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/connection.rb:402:in `new'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/connection.rb:402:in `socket'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/connection.rb:106:in `request_call'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/middlewares/mock.rb:47:in `request_call'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/middlewares/instrumentor.rb:25:in `request_call'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/middlewares/base.rb:15:in `request_call'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/middlewares/base.rb:15:in `request_call'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/middlewares/base.rb:15:in `request_call'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/middlewares/base.rb:15:in `request_call'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/connection.rb:250:in `request'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/middlewares/idempotent.rb:26:in `error_call'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/middlewares/base.rb:10:in `error_call'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/middlewares/base.rb:10:in `error_call'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/middlewares/base.rb:10:in `error_call'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/connection.rb:273:in `rescue in request'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/connection.rb:221:in `request'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/middlewares/idempotent.rb:26:in `error_call'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/middlewares/base.rb:10:in `error_call'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/middlewares/base.rb:10:in `error_call'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/middlewares/base.rb:10:in `error_call'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/connection.rb:273:in `rescue in request'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/connection.rb:221:in `request'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/middlewares/idempotent.rb:26:in `error_call'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/middlewares/base.rb:10:in `error_call'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/middlewares/base.rb:10:in `error_call'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/middlewares/base.rb:10:in `error_call'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/connection.rb:273:in `rescue in request'
        from /usr/lib/ruby/gems/2.2.0/gems/excon-0.51.0/lib/excon/connection.rb:221:in `request'
        from /usr/lib/ruby/gems/2.2.0/gems/docker-api-1.31.0/lib/docker/connection.rb:40:in `request'
        from /usr/lib/ruby/gems/2.2.0/gems/docker-api-1.31.0/lib/docker/connection.rb:65:in `block (2 levels) in <class:Connection>'
        from /usr/lib/ruby/gems/2.2.0/gems/docker-api-1.31.0/lib/docker/image.rb:200:in `all'
        from /usr/src/app/dockerfile-from-image.rb:32:in `<main>'

@dduvnjak
Copy link

dduvnjak commented Dec 25, 2016

@AnthonyWC somebody from CenturyLinkLabs just needs to trigger a new image build on docker hub, but they're not doing it for some reason :) If you build it yourself, the issue will be gone.

@krab-skunk
Copy link

krab-skunk commented Jan 12, 2017

@AnthonyWC
I had the same error as you, build it yourself using this Dockerfile:

FROM alpine:3.2
MAINTAINER CenturyLink Labs <[email protected]>

RUN apk --update add ruby-dev ca-certificates && \
    gem install --no-rdoc --no-ri docker-api && \
    apk del ruby-dev ca-certificates && \
    apk add ruby ruby-json && \
    rm /var/cache/apk/*

ADD dockerfile-from-image.rb /usr/src/app/dockerfile-from-image.rb
RUN chmod +x /usr/src/app/dockerfile-from-image.rb

ENTRYPOINT ["/usr/src/app/dockerfile-from-image.rb"]
CMD ["--help"]
docker build -t docker-from-file-image .

Make sure that /run/docker.sock exist on your system, if not, try with /var/run/docker.sock instead.

For the, it was the problem, i was using /run/docker.sock while the right path for my system was /var/run/docker.sock

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock  docker-from-file-image  docker-from-file-image
---------------
FROM alpine:3.2
RUN apk --update add ruby-dev ca-certificates && gem install --no-rdoc --no-ri docker-api && apk del ruby-dev ca-certificates && apk add ruby ruby-json && rm /var/cache/apk/*
ADD file:8a5c43d666322dd4df724cc7c2c838b2ef82e3656edcb4af264bcc89aedd4502 in /usr/src/app/dockerfile-from-image.rb
RUN chmod +x /usr/src/app/dockerfile-from-image.rb

I would say the result is close enough ;)

Docker version 1.13.0-rc4 on Mac OS X.11.6

@borgesp
Copy link

borgesp commented Mar 8, 2017

@dduvnjak Thanks a lot for the explanation/feedback, I've downloaded your "dduvnjak/dockerfile-from-image" and I don't get the "400 Bad Request: malformed Host header" error anymore.
However, in my case running your image doesn't output anything, any clue on what I'm doing wrong ?

@dduvnjak
Copy link

dduvnjak commented Mar 10, 2017

@borgesp what docker image are you running it against?

@borgesp
Copy link

borgesp commented Mar 10, 2017

@dduvnjak tried several, eg "nginx":

docker run -v /var/run/docker.sock:/var/run/docker.sock --rm dduvnjak/dockerfile-from-image nginx

@sgerrand
Copy link

sgerrand commented Apr 3, 2017

@bdehamer @davidgardner11 @SydOps: Is it possible to trigger a new build of this Docker image? That would resolve this issue.

@sscholl
Copy link

sscholl commented May 16, 2017

dduvnjak/dockerfile-from-image is not working for me. no output.

@aranelofdoriath
Copy link

The same for me:
/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)

docker -v

Docker version 17.03.1-ce, build c6d412e

@digitaldavenyc
Copy link

@dduvnjak It sorta worked for me but I only get the last line of the Dockerfile

@xiaowei0516
Copy link

not working for 1.12.6 either

environment:

  • docker vresion
    `Client:
    Version: 1.12.6
    API version: 1.24
    Package version: docker-1.12.6-28.git1398f24.el7.centos.x86_64
    Go version: go1.7.4
    Git commit: 1398f24/1.12.6
    Built: Fri May 26 17:28:18 2017
    OS/Arch: linux/amd64

Server:
Version: 1.12.6
API version: 1.24
Package version: docker-1.12.6-28.git1398f24.el7.centos.x86_64
Go version: go1.7.4
Git commit: 1398f24/1.12.6
Built: Fri May 26 17:28:18 2017
OS/Arch: linux/amd64
`

  • dockerfile-from-images image infomation
    docker.io/centurylink/dockerfile-from-image latest 970eaf375dfd 18 months ago 19.16 MB

  • error display
    /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

    '
    `

@xiaowei0516
Copy link

I find a solve way for above question.

https://github.com/xiaowei0516/dockerfile-from-image

thanks for origin author - lukapeschke . @lukapeschke

@hechien
Copy link

hechien commented Jun 27, 2017

@xiaowei0516 sorry, the link you pasted is not working, I don't see it.

But if I copied the link and paste it to the browser url address, it works.

@DanyC97
Copy link

DanyC97 commented Aug 24, 2017

@steve-heslouin just tried your steps against nginx image & docker version 17.05.0-ce and i get no output however no error either

@dragon788
Copy link

https://github.com/xiaowei0516/dockerfile-from-image

I submitted a PR to this repo fixing the issue that prevented it from building for me.

@TAGC
Copy link

TAGC commented Jan 5, 2018

Not working for me, Docker version 17.09.0-ce, build afdb6d4

@qubusp
Copy link

qubusp commented May 18, 2018

not working on Docker version 17.12.1-ce, build 7390fc6.

@yalopov
Copy link

yalopov commented Jul 8, 2018

not working on Docker version 18.05.0-ce, build f150324782

@jeremyary
Copy link

not working on Docker version 18.09.0, build 4d60db4 (macOS Mojave v10.14, MBPro retina late 2013)

@dorbodwolf
Copy link

dorbodwolf commented Jan 5, 2019

I find a solve way for above question.

https://github.com/xiaowei0516/dockerfile-from-image

thanks for origin author - lukapeschke . @lukapeschke

谢谢 你的方案可行
thanks your solution works
Docker version 18.09.0, build 4d60db4 on Ubuntu 16.04
please guys copy the link of @xiaowei0516 to any browser to enjoy it

@JackDanger
Copy link

This is fully fixed on #20

Available to test via:

docker pull jackdanger/dockerfile-from-image:latest
docker run -it -v /var/run/docker.sock:/var/run/docker.sock --rm jackdanger/dockerfile-from-image:latest jackdanger/dockerfile-from-image:latest

@dabula-s
Copy link

This is fully fixed on #20

Available to test via:

docker pull jackdanger/dockerfile-from-image:latest
docker run -it -v /var/run/docker.sock:/var/run/docker.sock --rm jackdanger/dockerfile-from-image:latest jackdanger/dockerfile-from-image:latest

have no output with this. no logs=(

@grv231
Copy link

grv231 commented Apr 13, 2019

Similar issue to what has ben described above by @SeriyVol4ishe. No Docker logs and no output. Docker version 18.09.2 on MacOS Mojave

Although I used this git repo created by @lukapeschke and its working as expected

@princekwame
Copy link

the git repo linked by @grv231 still works in 2020 running docker ver 19.03

@LinuxCuba
Copy link

This image linuxcuba/dockerfile-from-image from https://github.com/LinuxCuba/dockerfile-from-image/ fix the problem, is a fork from https://github.com/CenturyLinkLabs/dockerfile-from-image. Is work with docker and docker swarm 19.03.11 in debian 10 and all actuality modern OS.
docker pull linuxcuba/dockerfile-from-image:latest
Thanks.
Best regards.

@liudonghua123
Copy link

I tried to use linuxcuba/dockerfile-from-image or lukapeschke/dockerfile-from-image, none of them works for me.

[root@localhost dockerfile-from-image]# docker -v
Docker version 24.0.0, build 98fdcd7
[root@localhost dockerfile-from-image]# cat /etc/os-release 
NAME="AlmaLinux"
VERSION="9.2 (Turquoise Kodkod)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.2"
PLATFORM_ID="platform:el9"
PRETTY_NAME="AlmaLinux 9.2 (Turquoise Kodkod)"
ANSI_COLOR="0;34"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:almalinux:almalinux:9::baseos"
HOME_URL="https://almalinux.org/"
DOCUMENTATION_URL="https://wiki.almalinux.org/"
BUG_REPORT_URL="https://bugs.almalinux.org/"

ALMALINUX_MANTISBT_PROJECT="AlmaLinux-9"
ALMALINUX_MANTISBT_PROJECT_VERSION="9.2"
REDHAT_SUPPORT_PRODUCT="AlmaLinux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.2"
[root@localhost dockerfile-from-image]#
[root@localhost dockerfile-from-image]# docker run -it -v /var/run/docker.sock:/var/run/docker.sock --rm linuxcuba/dockerfile-from-image:latest eolinker/cluster-redis:6.2.7
You have new mail in /var/spool/mail/root
[root@localhost dockerfile-from-image]# docker pull linuxcuba/dockerfile-from-image:latest
latest: Pulling from linuxcuba/dockerfile-from-image
Digest: sha256:4aac5e4d729aa3fecb115eb7b76ecec8b9aabfb26aa1b9d6f1f64fad1dc507d0
Status: Image is up to date for linuxcuba/dockerfile-from-image:latest
docker.io/linuxcuba/dockerfile-from-image:latest
[root@localhost dockerfile-from-image]# docker run -it -v /var/run/docker.sock:/var/run/docker.sock --rm linuxcuba/dockerfile-from-image:latest eolinker/cluster-redis:6.2.7
[root@localhost dockerfile-from-image]# docker run -it -v /var/run/docker.sock:/var/run/docker.sock --rm linuxcuba/dockerfile-from-image:latest --help
Usage: dockerfile-from-image.rb [options] <image_id>
    -f, --full-tree                  Generate Dockerfile for all parent layers
    -h, --help                       Show this message
[root@localhost dockerfile-from-image]# docker run -it -v /var/run/docker.sock:/var/run/docker.sock --rm linuxcuba/dockerfile-from-image:latest 4cfebc77974f
[root@localhost dockerfile-from-image]#
[root@localhost dockerfile-from-image]# docker run --rm -v '/var/run/docker.sock:/var/run/docker.sock' lukapeschke/dockerfile-from-image lukapeschke/dockerfile-from-image:latest
Traceback (most recent call last):
  File "/root/entrypoint.py", line 54, in <module>
    my_obj = MainObj()
             ^^^^^^^^^
  File "/root/entrypoint.py", line 15, in __init__
    self._get_image(argv[-1])
  File "/root/entrypoint.py", line 26, in _get_image
    imgs = self.cli.images()
           ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/docker/api/image.py", line 40, in images
    res = self._result(self._get(self._url("/images/json"), params=params),
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/docker/utils/decorators.py", line 47, in inner
    return f(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/docker/client.py", line 139, in _get
    return self.get(url, **self._set_request_timeout(kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/requests/sessions.py", line 602, in get
    return self.request("GET", url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/requests/adapters.py", line 486, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/urllib3/connectionpool.py", line 790, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/urllib3/connectionpool.py", line 496, in _make_request
    conn.request(
TypeError: HTTPConnection.request() got an unexpected keyword argument 'chunked'
[root@localhost dockerfile-from-image]#

See also lukapeschke/dockerfile-from-image#2.

@liudonghua123
Copy link

I found some other useful tools for inspecting docker images or dockerfile.

[root@localhost 123]# # https://github.com/justone/dockviz
[root@localhost 123]# docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock nate/dockviz images --help
Usage:
  dockviz [OPTIONS] images [images-OPTIONS]

Application Options:
      --tlscacert=~/.docker/ca.pem          Trust certs signed only by this CA
      --tlscert=~/.docker/cert.pem          Path to TLS certificate file
      --tlskey=~/.docker/key.pem            Path to TLS key file
      --tlsverify                           Use TLS and verify the remote
  -H, --host=unix:///var/run/docker.sock    Docker host to connect to
  -v, --version                             Display version information.
      --stdin                               Enable reading image information from stdin (pre-Docker-1.11 only)

Help Options:
  -h, --help                                Show this help message

[images command options]
      -d, --dot                             Show image information as Graphviz dot. You can add a start image id or name -d/--dot [id/name]
      -t, --tree                            Show image information as tree. You can add a start image id or name -t/--tree [id/name]
      -s, --short                           Show short summary of images (repo name and list of tags).
      -n, --no-trunc                        Don't truncate the image IDs (only works with tree mode).
      -i, --incremental                     Display image size as incremental rather than cumulative.
      -l, --only-labelled                   Print only labelled images/containers.
          --show-created-by                 Show the image 'CreatedBy' to help identify layers.
      -c, --no-human                        Don't humanize the sizes.

[root@localhost 123]#
[root@localhost 123]# docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock nate/dockviz images -t eolinker/cluster-redis:6.2.7
└─4cfebc77974f Virtual Size: 112.8 MB Tags: eolinker/cluster-redis:6.2.7
[root@localhost 123]# # https://www.howtogeek.com/devops/how-to-create-a-dockerfile-from-an-existing-image/
[root@localhost 123]# docker run --rm -v /var/run/docker.sock:/var/run/docker.sock alpine/dfimage eolinker/cluster-redis:6.2.7
Analyzing eolinker/cluster-redis:6.2.7
Docker Version: 1.13.1
GraphDriver: overlay2
Environment Variables
|PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|GOSU_VERSION=1.14
|REDIS_VERSION=6.2.7
|REDIS_DOWNLOAD_URL=http://download.redis.io/releases/redis-6.2.7.tar.gz
|REDIS_DOWNLOAD_SHA=b7a79cc3b46d3c6eb52fa37dde34a4a60824079ebdfb3abfbbfa035947c55319
|TZ=Asia/Shanghai

Open Ports
|6379

Image user
|User is root

Potential secrets:
Dockerfile:
CMD ["bash"]
RUN groupadd -r -g 999 redis  \
	&& useradd -r -g redis -u 999 redis
ENV GOSU_VERSION=1.14
RUN set -eux; savedAptMark="$(apt-mark showmanual)"; apt-get update; apt-get install -y --no-install-recommends ca-certificates dirmngr gnupg wget; rm -rf /var/lib/apt/lists/*; dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; export GNUPGHOME="$(mktemp -d)"; gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; gpgconf --kill all; rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; apt-mark auto '.*' > /dev/null; [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; chmod +x /usr/local/bin/gosu; gosu --version; gosu nobody true
ENV REDIS_VERSION=6.2.7
ENV REDIS_DOWNLOAD_URL=http://download.redis.io/releases/redis-6.2.7.tar.gz
ENV REDIS_DOWNLOAD_SHA=b7a79cc3b46d3c6eb52fa37dde34a4a60824079ebdfb3abfbbfa035947c55319
RUN set -eux; savedAptMark="$(apt-mark showmanual)"; apt-get update; apt-get install -y --no-install-recommends ca-certificates wget dpkg-dev gcc libc6-dev libssl-dev make ; rm -rf /var/lib/apt/lists/*; wget -O redis.tar.gz "$REDIS_DOWNLOAD_URL"; echo "$REDIS_DOWNLOAD_SHA *redis.tar.gz" | sha256sum -c -; mkdir -p /usr/src/redis; tar -xzf redis.tar.gz -C /usr/src/redis --strip-components=1; rm redis.tar.gz; grep -E '^ *createBoolConfig[(]"protected-mode",.*, *1 *,.*[)],$' /usr/src/redis/src/config.c; sed -ri 's!^( *createBoolConfig[(]"protected-mode",.*, *)1( *,.*[)],)$!\10\2!' /usr/src/redis/src/config.c; grep -E '^ *createBoolConfig[(]"protected-mode",.*, *0 *,.*[)],$' /usr/src/redis/src/config.c; gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; extraJemallocConfigureFlags="--build=$gnuArch"; dpkgArch="$(dpkg --print-architecture)"; case "${dpkgArch##*-}" in amd64 | i386 | x32) extraJemallocConfigureFlags="$extraJemallocConfigureFlags --with-lg-page=12" ;; *) extraJemallocConfigureFlags="$extraJemallocConfigureFlags --with-lg-page=16" ;; esac; extraJemallocConfigureFlags="$extraJemallocConfigureFlags --with-lg-hugepage=21"; grep -F 'cd jemalloc  \
	&& ./configure ' /usr/src/redis/deps/Makefile; sed -ri 's!cd jemalloc  \
	&& ./configure !&'"$extraJemallocConfigureFlags"' !' /usr/src/redis/deps/Makefile; grep -F "cd jemalloc  \
	&& ./configure $extraJemallocConfigureFlags " /usr/src/redis/deps/Makefile; export BUILD_TLS=yes; make -C /usr/src/redis -j "$(nproc)" all; make -C /usr/src/redis install; serverMd5="$(md5sum /usr/local/bin/redis-server | cut -d' ' -f1)"; export serverMd5; find /usr/local/bin/redis* -maxdepth 0 -type f -not -name redis-server -exec sh -eux -c ' md5="$(md5sum "$1" | cut -d" " -f1)"; test "$md5" = "$serverMd5"; ' -- '{}' ';' -exec ln -svfT 'redis-server' '{}' ';' ; rm -r /usr/src/redis; apt-mark auto '.*' > /dev/null; [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; find /usr/local -type f -executable -exec ldd '{}' ';' | awk '/=>/ { print $(NF-1) }' | sort -u | xargs -r dpkg-query --search | cut -d: -f1 | sort -u | xargs -r apt-mark manual ; apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; redis-cli --version; redis-server --version
RUN mkdir /data  \
	&& chown redis:redis /data
VOLUME [/data]
WORKDIR /data
COPY file:e873a0e3c13001b5e1c63f9dbe60cc65722af522671787f68b8e8cbcae7d02ac in /usr/local/bin/
	usr/
	usr/local/
	usr/local/bin/
	usr/local/bin/docker-entrypoint.sh

ENTRYPOINT ["docker-entrypoint.sh"]
EXPOSE 6379
CMD ["redis-server"]
MAINTAINER cluster_redis
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime  \
	&& echo $TZ > /etc/timezone
RUN mkdir -p /usr/local/cluster_redis/data
COPY file:da72ca74e4ea3b43aeea25f323a1e3e3c5d1fb0eea342450c291efbed37d2688 in /usr/local/cluster_redis
	usr/
	usr/local/
	usr/local/cluster_redis/
	usr/local/cluster_redis/start.sh

WORKDIR /usr/local/cluster_redis
CMD ["./start.sh"]

[root@localhost 123]#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests