RUN apt-get p7zip don't work in docker 20. Please tell me how can I proceed forward.

Created by Taurus
@Taurus , The directory you are mounting that contains the input files should be present when you run the Docker container (not when you build).
@vchung Please tell me if the mapping directory for eg. input and output directory ( as given in your example above ) should be there while building docker image?
@Taurus , Assuming that the inference script will output results into the `/output` directory, you should be able to retrieve the results in whichever directory is mounted during the test run. For example, let's say your Docker run command is so: ```bash docker run --rm \ --network none --gpus device=0 \ --name test_model \ -v $PWD/BraTS2021_00001:/input:ro \ -v $PWD/results:/output:rw \ model1:v1 ``` where: - `test_model` is the container name - `$PWD/BraTS2021_00001` is the absolute path to the folder containing the input files - `$PWD/results` is the absolute path to the folder that will contain the output files - `model1:v1` is the image name and tag
@vchung I am trying your suggestions . Also I want to ask if image built successfully and tested on local pc, the output will be reflected to local pc or not?
@Taurus , Perhaps [this](https://itsfoss.com/unable-to-locate-package-error-ubuntu/) could be of more help to resolving the error? You could alternatively try using a different [ubuntu tag](https://hub.docker.com/_/ubuntu?tab=tags&page=1&ordering=last_updated) as well, such as `ubuntu:bionic`, 'ubuntu:groovy', etc. Sorry I couldn't be of more help.
@vchung Thanks. I tried this also but its not working. user1@dell-workstation-10:~/RAK$ docker build -t docker . Sending build context to Docker daemon 3.949GB Step 1/5 : FROM ubuntu:18.04 ---> 54919e10a95d Step 2/5 : RUN apt-get install p7zip ---> Running in 91fcde8d56fa Reading package lists... Building dependency tree... Reading state information... E: Unable to locate package p7zip The command '/bin/sh -c apt-get install p7zip' returned a non-zero code: 100
@Taurus , Thank you for providing more context with your Dockerfile. To be candid, I do not have extensive experience with doing [multi-stage builds](https://docs.docker.com/develop/develop-images/multistage-build/), but if my understanding is correct, I believe your error stems here: ```dockerfile FROM ubuntu:18.04 FROM python:3.7 ``` Because `apt-get` is Linux-specific command, you may need to call that RUN command prior to the second FROM command, e.g. ```dockerfile FROM ubuntu:18.04 RUN apt-get install p7zip CMD 7z x ANTs-28-03-2019.7z FROM python:3.7 RUN python3.7 -m pip install pip ... ```
@vchung I wrote same syntax but i got this error: E: Unable to locate package p7zip The command '/bin/sh -c apt-get install p7zip' returned a non-zero code: 100 My docker version is : Docker version 20.10.8, build 3967b7d this is my Dockerfile: FROM ubuntu:18.04 FROM python:3.7 WORKDIR /home/user1/RAK/ ADD . /home/user1/RAK/ RUN chmod -R 777 /home/user1/RAK/ RUN ls -la /home/user1/RAK/ && pwd RUN apt-get install p7zip CMD 7z x ANTs-28-03-2019.7z RUN python3.7 -m pip install pip RUN pip3 install tensorflow-gpu==2.1.0 RUN pip3 install keras==2.3.1 RUN pip3 install SimpleITK==2.0.2 RUN pip3 install scikit-image==0.18.1 RUN pip3 install pydicom==0.9.9 RUN pip3 install transforms3d==0.3.1 RUN pip3 install nilearn==0.7.1 RUN pip3 install nipype==1.6.0 RUN pip3 install tables==3.6.1 CMD [ "python3.7", "./main_segmentation_resnet.py" ] CMD [ "python3.7", "./main_segmentation_unet.py" ] CMD [ "python3.7", "./main_segmentation_resdnet.py" ] CMD ["python3.7", "./merge_segmentation_results.py","output/test/","Validation2021/input/"] ENTRYPOINT [ "python3.7", "./preprocessing.py" ] Please let me know what I am missing?
Hi @Taurus , I think you are missing `install` in the RUN line, e.g. ``` RUN apt-get install p7zip ``` Hope this helps!

Not able to install ANT n4 bias library having .7z extension page is loading…