Question
· Sep 20, 2017

Ubuntu / Docker Error when trying to build ensemble docker container

Hi, I was hoping that someone could point me to the error in my ways.  I am trying to follow the examples to setup Ensemble 2017.1 in a docker container on an Ubuntu 16.04 virtual machine.

I have a directory that contains

Dockerfile
cache.key
ensemble-lnxubuntux64.tar.gz

When I execute:

docker build -t ensemble-simple .

I am getting the following error:

poindext@ubuntu:~/ensemble-docker$ docker build -t ensemble-simple .
Sending build context to Docker daemon  706.3MB
Step 1/13 : FROM ubuntu
 ---> 2d696327ab2e
Step 2/13 : MAINTAINER Dmitry Maslennikov <Dmitry.Maslennikov@csystem.cz>
 ---> Using cache
 ---> 4e06c3ce5f58
Step 3/13 : RUN yum -y update  && yum -y install which tar hostname net-tools wget  && yum -y clean all  && ln -sf /etc/locatime /usr/share/zoneinfo/Europe/Prague
 ---> Running in de0f17c58546
/bin/sh: 1: yum: not found
The command '/bin/sh -c yum -y update  && yum -y install which tar hostname net-tools wget  && yum -y clean all  && ln -sf /etc/locatime /usr/share/zoneinfo/Europe/Prague' returned a non-zero code: 127
poindext@ubuntu:~/ensemble-docker$ 

Notice the error /bin/sh: 1:yum: not found

Here is the contents of my Dockerfile

FROM ubuntu

MAINTAINER Dmitry Maslennikov <Dmitry.Maslennikov@csystem.cz>

# update OS + dependencies & run Caché silent instal
RUN yum -y update \
 && yum -y install which tar hostname net-tools wget \
 && yum -y clean all \ 
 && ln -sf /etc/locatime /usr/share/zoneinfo/Europe/Prague

ARG password="Qwerty@12"
ARG cache=ensemble-2016.2.1.803.0

ENV TMP_INSTALL_DIR=/tmp/distrib

# vars for Caché silent install
ENV ISC_PACKAGE_INSTANCENAME="ENSEMBLE" \
    ISC_PACKAGE_INSTALLDIR="/opt/ensemble/" \
    ISC_PACKAGE_UNICODE="Y" \
    ISC_PACKAGE_CLIENT_COMPONENTS="" \
    ISC_PACKAGE_INITIAL_SECURITY="Normal" \
    ISC_PACKAGE_USER_PASSWORD=${password} 

# set-up and install Caché from distrib_tmp dir 
WORKDIR ${TMP_INSTALL_DIR}

ADD $ensemble-lnxubuntux64.tar.gz .

# cache distributive
RUN ./$ensemble-lnxubuntux64/cinstall_silent \
 && ccontrol stop $ISC_PACKAGE_INSTANCENAME quietly \
# Caché container main process PID 1 (https://github.com/zrml/ccontainermain)
 && curl -L https://github.com/daimor/ccontainermain/raw/master/distrib/linux/ccontainermain -o /ccontainermain \
 && chmod +x /ccontainermain \
 && rm -rf $TMP_INSTALL_DIR 

WORKDIR ${ISC_PACKAGE_INSTALLDIR}

# TCP sockets that can be accessed if user wants to (see 'docker run -p' flag)
EXPOSE 57772 1972

ENTRYPOINT ["/ccontainermain", "-cconsole", "-i", "ensemble"]

I was hoping that someone familiar with docker could point me to my error.  I dont believe the error is indicating that the yum command isnt installed on my server as I can run:

poindext@ubuntu:~$ which yum
/usr/bin/yum

Which I think indicates that yum is there.

Can anyone see anything specific wrong with my Dockerfile?  Admittedly I know nothing about docker at this point.  Just trying to get something going.

Discussion (2)2
Log in or sign up to continue

Hi Kenneth

Your container is based on a ubuntu distribution per the "FROM ubuntu" command in the dockerfile.

I believe ubuntu by default comes with and uses the application "apt-get" to do a similar function as yum, so, your yum commands running inside the ubuntu container you are starting with needs to retrieve yum, or instead, use apt commands.

however .. you say you believe that yum is installed because you executed:

which yum
/usr/bin/yum

- so the question is - did you execute this inside the container or outside of it, ie, on your VM.  Your VM (although running UBUNTU16.04), may have had yum downloaded into it - but the base ubuntu container you are using for your container definitely thinks you need this.

Equivalent apt-get commands you can use perhaps,  in place of the yum ones would be:

RUN apt-get update \
  && apt-get install which tar hostname net-tools wget \
  && apt-get clean all\ 
  && ln -sf /etc/locatime /usr/share/zoneinfo/Europe/Prague

Try that -

sincerely,

Steve