Closed farhanraza15 closed 6 years ago
You need to do apt-get update
to populate the repository metadata
$ docker pull redis
Using default tag: latest
latest: Pulling from library/redis
be8881be8156: Pull complete
d6f5ea773ca3: Pull complete
735cc65c0db4: Pull complete
ff89c30e4d8c: Pull complete
59bf782a86b3: Pull complete
ce8aaa9fe90a: Pull complete
Digest: sha256:096cff9e6024603decb2915ea3e501c63c5bb241e1b56830a52acfd488873843
Status: Downloaded newer image for redis:latest
$ docker run --rm -dit --name redis redis
$ docker exec -it redis bash
root@b4a600d3005d:/data# apt update
Get:3 http://security.debian.org/debian-security stretch/updates InRelease [94.3 kB]
0% [Connecting to cdn-fastly.deb.debian.org (151.101.52.204)] [3 InRelease 13. Ign:1 http://cdn-fastly.deb.debian.org/debian stretch InRelease
Get:2 http://cdn-fastly.deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Get:5 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [372 kB]
0% [2 InRelease gpgv 91.0 kB] [Waiting for headers] [5 Packages 80.3 kB/372 kB Get:4 http://cdn-fastly.deb.debian.org/debian stretch Release [118 kB]
0% [2 InRelease gpgv 91.0 kB] [4 Release 3526 B/118 kB 3%] [5 Packages 258 kB/ 0% [5 Packages store 0 B] [2 InRelease gpgv 91.0 kB] [4 Release 74.7 kB/118 kB Get:6 http://cdn-fastly.deb.debian.org/debian stretch-updates/main amd64 Packages [11.0 kB]
Get:7 http://cdn-fastly.deb.debian.org/debian stretch Release.gpg [2434 B]
Get:8 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 Packages [7099 kB]
Fetched 7787 kB in 3s (2428 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
root@b4a600d3005d:/data# apt install openjdk-8-jre
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
adwaita-icon-theme at-spi2-core ca-certificates ca-certificates-java dbus
dconf-gsettings-backend dconf-service fontconfig fontconfig-config
fonts-dejavu-core fonts-dejavu-extra glib-networking glib-networking-common
glib-networking-services gsettings-desktop-schemas gtk-update-icon-cache
hicolor-icon-theme java-common krb5-locales libapparmor1 libasound2
libasound2-data libasyncns0 libatk-bridge2.0-0 libatk-wrapper-java
libatk-wrapper-java-jni libatk1.0-0 libatk1.0-data libatspi2.0-0
libavahi-client3 libavahi-common-data libavahi-common3 libbsd0
libcairo-gobject2 libcairo2 libcap2 libcolord2 libcroco3 libcups2 libdatrie1
libdbus-1-3 libdconf1 libdrm-amdgpu1 libdrm-intel1 libdrm-nouveau2
libdrm-radeon1 libdrm2 libedit2 libegl1-mesa libelf1 libepoxy0 libexpat1
libffi6 libflac8 libfontconfig1 libfontenc1 libfreetype6 libgail-common
libgail18 libgbm1 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgif7
libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libglib2.0-0 libglib2.0-data
libgmp10 libgnutls30 libgpm2 libgraphite2-3 libgssapi-krb5-2 libgtk-3-0
libgtk-3-bin libgtk-3-common libgtk2.0-0 libgtk2.0-bin libgtk2.0-common
libharfbuzz0b libhogweed4 libice6 libicu57 libidn11 libjbig0 libjpeg62-turbo
libjson-glib-1.0-0 libjson-glib-1.0-common libk5crypto3 libkeyutils1
libkrb5-3 libkrb5support0 liblcms2-2 libllvm3.9 libncurses5 libnettle6
libnspr4 libnss3 libogg0 libp11-kit0 libpango-1.0-0 libpangocairo-1.0-0
libpangoft2-1.0-0 libpciaccess0 libpcsclite1 libpixman-1-0 libpng16-16
libproxy1v5 libpulse0 librest-0.7-0 librsvg2-2 librsvg2-common libsensors4
libsm6 libsndfile1 libsoup-gnome2.4-1 libsoup2.4-1 libsqlite3-0 libssl1.1
libtasn1-6 libthai-data libthai0 libtiff5 libtxc-dxtn-s2tc libvorbis0a
libvorbisenc2 libwayland-client0 libwayland-cursor0 libwayland-egl1-mesa
libwayland-server0 libwrap0 libx11-6 libx11-data libx11-xcb1 libxau6 libxaw7
libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-render0
libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-xfixes0 libxcb1 libxcomposite1
libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxft2 libxi6
libxinerama1 libxkbcommon0 libxml2 libxmu6 libxmuu1 libxpm4 libxrandr2
libxrender1 libxshmfence1 libxt6 libxtst6 libxv1 libxxf86dga1 libxxf86vm1
openjdk-8-jre-headless openssl sgml-base shared-mime-info tcpd ucf
x11-common x11-utils xdg-user-dirs xkb-data xml-core
Suggested packages:
default-dbus-session-bus | dbus-session-bus default-jre libasound2-plugins
alsa-utils colord cups-common gnutls-bin gpm krb5-doc krb5-user gvfs
liblcms2-utils pciutils pcscd pulseaudio librsvg2-bin lm-sensors
icedtea-8-plugin libnss-mdns fonts-ipafont-gothic fonts-ipafont-mincho
fonts-wqy-microhei fonts-wqy-zenhei fonts-indic sgml-base-doc mesa-utils
debhelper
The following NEW packages will be installed:
adwaita-icon-theme at-spi2-core ca-certificates ca-certificates-java dbus
dconf-gsettings-backend dconf-service fontconfig fontconfig-config
fonts-dejavu-core fonts-dejavu-extra glib-networking glib-networking-common
glib-networking-services gsettings-desktop-schemas gtk-update-icon-cache
hicolor-icon-theme java-common krb5-locales libapparmor1 libasound2
libasound2-data libasyncns0 libatk-bridge2.0-0 libatk-wrapper-java
libatk-wrapper-java-jni libatk1.0-0 libatk1.0-data libatspi2.0-0
libavahi-client3 libavahi-common-data libavahi-common3 libbsd0
libcairo-gobject2 libcairo2 libcap2 libcolord2 libcroco3 libcups2 libdatrie1
libdbus-1-3 libdconf1 libdrm-amdgpu1 libdrm-intel1 libdrm-nouveau2
libdrm-radeon1 libdrm2 libedit2 libegl1-mesa libelf1 libepoxy0 libexpat1
libffi6 libflac8 libfontconfig1 libfontenc1 libfreetype6 libgail-common
libgail18 libgbm1 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgif7
libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libglib2.0-0 libglib2.0-data
libgmp10 libgnutls30 libgpm2 libgraphite2-3 libgssapi-krb5-2 libgtk-3-0
libgtk-3-bin libgtk-3-common libgtk2.0-0 libgtk2.0-bin libgtk2.0-common
libharfbuzz0b libhogweed4 libice6 libicu57 libidn11 libjbig0 libjpeg62-turbo
libjson-glib-1.0-0 libjson-glib-1.0-common libk5crypto3 libkeyutils1
libkrb5-3 libkrb5support0 liblcms2-2 libllvm3.9 libncurses5 libnettle6
libnspr4 libnss3 libogg0 libp11-kit0 libpango-1.0-0 libpangocairo-1.0-0
libpangoft2-1.0-0 libpciaccess0 libpcsclite1 libpixman-1-0 libpng16-16
libproxy1v5 libpulse0 librest-0.7-0 librsvg2-2 librsvg2-common libsensors4
libsm6 libsndfile1 libsoup-gnome2.4-1 libsoup2.4-1 libsqlite3-0 libssl1.1
libtasn1-6 libthai-data libthai0 libtiff5 libtxc-dxtn-s2tc libvorbis0a
libvorbisenc2 libwayland-client0 libwayland-cursor0 libwayland-egl1-mesa
libwayland-server0 libwrap0 libx11-6 libx11-data libx11-xcb1 libxau6 libxaw7
libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-render0
libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-xfixes0 libxcb1 libxcomposite1
libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxft2 libxi6
libxinerama1 libxkbcommon0 libxml2 libxmu6 libxmuu1 libxpm4 libxrandr2
libxrender1 libxshmfence1 libxt6 libxtst6 libxv1 libxxf86dga1 libxxf86vm1
openjdk-8-jre openjdk-8-jre-headless openssl sgml-base shared-mime-info tcpd
ucf x11-common x11-utils xdg-user-dirs xkb-data xml-core
0 upgraded, 180 newly installed, 0 to remove and 0 not upgraded.
Need to get 108 MB of archives.
After this operation, 488 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://security.debian.org/debian-security stretch/updates/main amd64 libcups2 amd64 2.2.1-8+deb9u2 [306 kB]
Get:2 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libexpat1 amd64 2.2.0-2+deb9u1 [83.4 kB]
Get:3 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libpng16-16 amd64 1.6.28-1 [280 kB]
Get:4 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libfreetype6 amd64 2.6.3-3.2 [438 kB]
Get:5 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 ucf all 3.0036 [70.2 kB]
Get:6 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 fonts-dejavu-core all 2.37-1 [1068 kB]
Get:7 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 fontconfig-config all 2.11.0-6.7 [271 kB]
Get:8 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libfontconfig1 amd64 2.11.0-6.7+b1 [331 kB]
Get:9 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 fontconfig amd64 2.11.0-6.7+b1 [404 kB]
Get:10 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libogg0 amd64 1.3.2-1 [19.9 kB]
Get:11 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libxau6 amd64 1:1.0.8-1 [20.7 kB]
Get:12 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 sgml-base all 1.29 [14.8 kB]
Get:13 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libssl1.1 amd64 1.1.0f-3+deb9u2 [1344 kB]
Get:14 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libapparmor1 amd64 2.11.0-3+deb9u2 [78.9 kB]
Get:15 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libdbus-1-3 amd64 1.10.26-0+deb9u1 [194 kB]
Get:16 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 dbus amd64 1.10.26-0+deb9u1 [210 kB]
Get:17 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 krb5-locales all 1.15-1+deb9u1 [93.8 kB]
Get:18 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libcap2 amd64 1:2.25-1 [16.8 kB]
Get:19 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libbsd0 amd64 0.8.3-1 [83.0 kB]
Get:20 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libncurses5 amd64 6.0+20161126-1+deb9u2 [93.4 kB]
Get:21 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libedit2 amd64 3.1-20160903-3 [84.8 kB]
Get:22 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libgmp10 amd64 2:6.1.2+dfsg-1 [253 kB]
Get:23 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libnettle6 amd64 3.3-1+b2 [192 kB]
Get:24 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libhogweed4 amd64 3.3-1+b2 [136 kB]
Get:25 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libidn11 amd64 1.33-1 [115 kB]
Get:26 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libffi6 amd64 3.2.1-6 [20.4 kB]
Get:27 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libp11-kit0 amd64 0.23.3-2 [111 kB]
Get:28 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libtasn1-6 amd64 4.10-1.1+deb9u1 [50.6 kB]
Get:29 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libgnutls30 amd64 3.5.8-5+deb9u3 [895 kB]
Get:30 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libgpm2 amd64 1.20.4-6.2+b1 [34.2 kB]
Get:31 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libkeyutils1 amd64 1.5.9-9 [12.4 kB]
Get:32 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libkrb5support0 amd64 1.15-1+deb9u1 [61.9 kB]
Get:33 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libk5crypto3 amd64 1.15-1+deb9u1 [119 kB]
Get:34 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libkrb5-3 amd64 1.15-1+deb9u1 [311 kB]
Get:35 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libgssapi-krb5-2 amd64 1.15-1+deb9u1 [155 kB]
Get:36 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libsqlite3-0 amd64 3.16.2-5+deb9u1 [572 kB]
10% [36 libsqlite3-0 158 kB/572 kB 28%]^C
Sorry that I missed it mentioning, I did execute the apt-get update before.
@wglambert please suggest This is exact command I have in my Dockerfile for redis 4.0.10 image. I tried changing the jessie-backports to stretch-backports as well
RUN echo "deb http://http.debian.net/debian jessie-backports main" >> /etc/apt/sources.list \ && apt-get update && apt-get install -y -t jessie-backports openjdk-8-jdk \ && rm -rf /var/lib/apt/lists/* \ && ln -s /usr/lib/jvm/java-8-openjdk-amd64 /jdk
I ran the exact same command you have used but same error:
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/rmid to provide /usr/bin/rmid (rmid) in auto mode update-alternatives: error: error creating symbolic link '/usr/share/man/man1/rmid.1.gz.dpkg-tmp': No such file or directory dpkg: error processing package openjdk-8-jre-headless:amd64 (--configure): subprocess installed post-installation script returned error exit status 2 dpkg: dependency problems prevent configuration of ca-certificates-java: ca-certificates-java depends on openjdk-7-jre-headless | java7-runtime-headless; however: Package openjdk-7-jre-headless is not installed. Package java7-runtime-headless is not installed. Package openjdk-8-jre-headless:amd64 which provides java7-runtime-headless is not configured yet.
dpkg: error processing package ca-certificates-java (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of openjdk-8-jre:amd64: openjdk-8-jre:amd64 depends on openjdk-8-jre-headless (= 8u171-b11-1~deb9u1); however: Package openjdk-8-jre-headless:amd64 is not configured yet.
dpkg: error processing package openjdk-8-jre:amd64 (--configure): dependency problems - leaving unconfigured Processing triggers for libc-bin (2.24-11+deb9u3) ... Processing triggers for sgml-base (1.29) ... Processing triggers for ca-certificates (20161130+nmu1+deb9u1) ... Updating certificates in /etc/ssl/certs... 0 added, 0 removed; done. Running hooks in /etc/ca-certificates/update.d... done. Processing triggers for libgdk-pixbuf2.0-0:amd64 (2.36.5-2+deb9u2) ... Errors were encountered while processing: openjdk-8-jre-headless:amd64 ca-certificates-java openjdk-8-jre:amd64 E: Sub-process /usr/bin/dpkg returned an error code (1)
The redis:4.0.10
image uses stretch-slim
https://github.com/docker-library/redis/blob/d65f230a2d7713db10ac44975d0748f8bd323d02/4.0/Dockerfile#L1
I found this comment and replicated his Dockerfile
which seems to be what you want
FROM redis:4.0.10
RUN mkdir -p /usr/share/man/man1 && \
(echo "deb http://http.debian.net/debian stretch-backports main" > /etc/apt/sources.list.d/backports.list) && \
apt-get update -y && \
apt-get install -t stretch-backports openjdk-8-jdk -y
Docker build
$ docker build . -t redis_test
Sending build context to Docker daemon 2.56kB
Step 1/2 : FROM redis:4.0.10
---> f06a5773f01e
Step 2/2 : RUN mkdir -p /usr/share/man/man1 && (echo "deb http://http.debian.net/debian stretch-backports main" > /etc/apt/sources.list.d/backports.list) && apt-get update -y && apt-get install -t stretch-backports openjdk-8-jdk -y
---> Using cache
---> a52ae0841746
Successfully built a52ae0841746
Successfully tagged redis_test:latest
If you have further questions on assembling the Dockerfile
or other things relating to usability then you should ask over at the Docker Community Forums, the Docker Community Slack, or Stack Overflow. As there isn't any error in the image I'm going to close.
Thanks a bunch @wglambert on a side note what is the use of mkdir -p /usr/share/man/man1
I saw after creating it is dumping few .gz files there and I believe this is the only line I missed so far
That'd be for https://github.com/debuerreotype/debuerreotype/issues/10
After installing redis image (4.0.10) - docker pull redis
Executed docker run -it IMAGEID bash then apt-get -y install openjdk-8-jdk
Getting below error
Setting up openjdk-8-jre-headless:amd64 (8u171-b11-1~deb9u1) ... update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/rmid to provide /usr/bin/rmid (rmid) in auto mode update-alternatives: error: error creating symbolic link '/usr/share/man/man1/rmid.1.gz.dpkg-tmp': No such file or directory dpkg: error processing package openjdk-8-jre-headless:amd64 (--configure): subprocess installed post-installation script returned error exit status 2 dpkg: dependency problems prevent configuration of ca-certificates-java: ca-certificates-java depends on openjdk-7-jre-headless | java7-runtime-headless; however: Package openjdk-7-jre-headless is not installed. Package java7-runtime-headless is not installed. Package openjdk-8-jre-headless:amd64 which provides java7-runtime-headless is not configured yet.
dpkg: error processing package ca-certificates-java (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of openjdk-8-jdk-headless:amd64: openjdk-8-jdk-headless:amd64 depends on openjdk-8-jre-headless (= 8u171-b11-1~deb9u1); however: Package openjdk-8-jre-headless:amd64 is not configured yet.
dpkg: error processing package openjdk-8-jdk-headless:amd64 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of openjdk-8-jdk:amd64: openjdk-8-jdk:amd64 depends on openjdk-8-jdk-headless (= 8u171-b11-1~deb9u1); however: Package openjdk-8-jdk-headless:amd64 is not configured yet.
dpkg: error processing package openjdk-8-jdk:amd64 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of openjdk-8-jre:amd64: openjdk-8-jre:amd64 depends on openjdk-8-jre-headless (= 8u171-b11-1~deb9u1); however: Package openjdk-8-jre-headless:amd64 is not configured yet.
dpkg: error processing package openjdk-8-jre:amd64 (--configure): dependency problems - leaving unconfigured Processing triggers for libc-bin (2.24-11+deb9u3) ... Processing triggers for sgml-base (1.29) ... Processing triggers for ca-certificates (20161130+nmu1+deb9u1) ... Updating certificates in /etc/ssl/certs... 0 added, 0 removed; done. Running hooks in /etc/ca-certificates/update.d... done. Processing triggers for libgdk-pixbuf2.0-0:amd64 (2.36.5-2+deb9u2) ... Errors were encountered while processing: openjdk-8-jre-headless:amd64 ca-certificates-java openjdk-8-jdk-headless:amd64 openjdk-8-jdk:amd64 openjdk-8-jre:amd64 E: Sub-process /usr/bin/dpkg returned an error code (1)