2

I'm building several docker images, but I can't seem to access certain commands although I'm importing images containing said commands. Example:

# Dockerfile ubuntu-essentials
FROM ubuntu:14.04

RUN apt-get update
RUN apt-get -y install ssh rsync git graphviz gedit-plugins wget nano zlibc zlib1g-dev build-essential libncurses5-dev libncursesw5-dev libboost-dev gdebi software-properties-common unzip


# Dockerfile fastqc
FROM ubuntu:14.04
FROM rioualen/ubuntu-essentials:1.0

ENV SOURCE_DIR=~/app_sources/
ENV BIN_DIR=~/bin/

WORKDIR ${SOURCE_DIR}
RUN wget --no-clobber http://www.bioinformatics.babraham.ac.uk/projects/fastqc/fastqc_v0.11.5.zip
RUN unzip -o fastqc_v0.11.5.zip

This raises an error "unzip not found" though it's installed in first image. The command wget works perfectly fine.

When adding the install of unzip in the second Dockerfile, it works normally:

# Dockerfile fastqc
FROM ubuntu:14.04
FROM rioualen/ubuntu-essentials:1.0

ENV SOURCE_DIR=~/app_sources/
ENV BIN_DIR=~/bin/

RUN apt-get -y install unzip 

WORKDIR ${SOURCE_DIR}
RUN wget --no-clobber http://www.bioinformatics.babraham.ac.uk/projects/fastqc/fastqc_v0.11.5.zip
RUN unzip -o fastqc_v0.11.5.zip

Any idea? Being new to Docker, I don't know what to look for... Thank you.

0

Several "FROM"s don't work the way you expect. Take each FROM as a separator for a new image. That means you're building 3 different images and the last one will be:

    FROM rioualen/ubuntu-essentials:1.0

    ENV SOURCE_DIR=~/app_sources/
    ENV BIN_DIR=~/bin/

    WORKDIR ${SOURCE_DIR}
    RUN wget --no-clobber http://www.bioinformatics.babraham.ac.uk/projects/fastqc/fastqc_v0.11.5.zip
    RUN unzip -o fastqc_v0.11.5.zip

Where you haven't installed unzip in.

The documentation on it is a little sparse, but I think it explains it fine.

I would suggest you put each image you want to build in it's own Dockerfile which means only having one "FROM" in each. This will give you much better transparency on what's going on.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.