Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker container not able to locate Zip packages?

Tags:

docker

All Ubuntu wiley repositories are added to my Dockerfile, namely main, universe, etc. and are present in my docker image. However, apt-get install in the following Dockerfile is not able to locate any ZIP/UnZIP packages. Error log in the end.

How can I install these common zip packages? At least p7zip-full and rar.

Dockerfile

FROM ubuntu:15.10
CMD ["bash"]
RUN add-apt-repository main && \
    add-apt-repository universe && \
    add-apt-repository restricted && \
    add-apt-repository multiverse
RUN  apt-get update -y && \
     apt-get upgrade -y && \
     apt-get dist-upgrade -y && \
     apt-get -y autoremove && \
     apt-get clean
RUN apt-get install p7zip \
    p7zip-full \
    p7zip-rar \
    unace \
    unrar \
    zip \
    unzip \
    xz-utils \
    sharutils \
    rar \
    uudeview \
    mpack \
    arj \
    cabextract \
    file-roller \
    && rm -rf /var/lib/apt/lists/*

ERROR THROWN

E: Unable to locate package p7zip-full
E: Unable to locate package unace
E: Unable to locate package unrar
E: Unable to locate package zip
E: Unable to locate package unzip
E: Unable to locate package sharutils
E: Unable to locate package rar
E: Unable to locate package uudeview
E: Unable to locate package mpack
E: Unable to locate package arj
E: Unable to locate package cabextract
E: Unable to locate package file-roller
like image 509
SACn Avatar asked Jan 14 '17 14:01

SACn


People also ask

What does Workdir mean in Docker?

The WORKDIR command is used to define the working directory of a Docker container at any given time. The command is specified in the Dockerfile. Any RUN , CMD , ADD , COPY , or ENTRYPOINT command will be executed in the specified working directory.


1 Answers

Tried with this Dockerfile (your Dockerfile without what I told you in my previous comment):

FROM ubuntu:15.10
RUN  apt-get update -y && \
     apt-get upgrade -y && \
     apt-get dist-upgrade -y && \
     apt-get -y autoremove && \
     apt-get clean
RUN apt-get install -y p7zip \
    p7zip-full \
    unace \
    zip \
    unzip \
    xz-utils \
    sharutils \
    uudeview \
    mpack \
    arj \
    cabextract \
    file-roller \
    && rm -rf /var/lib/apt/lists/*

CMD ["bash"]

It works and it installs zip and p7zip

$ docker build -t mytest .
$ docker run -d -ti --name mytest mytest /bin/bash
$ docker exec -ti mytest /bin/bash

 root@f01fc3456a2a:/# zip 
 root@f01fc3456a2a:/# p7zip
like image 78
gile Avatar answered Oct 13 '22 01:10

gile