Liberty Docker Image is not running

767 Views Asked by At

When I try to run the docker image I am getting this error:

C:\Program Files\Docker Toolbox\docker.exe: Error response from 
daemon: invalid header field value "oci runtime error: 
container_linux.go:247: starting container process caused 
\"exec: \\\"/opt/ibm/docker/docker-server\\\": 
stat /opt/ibm/docker/docker-server: no such file or 
directory\"\n".**

I have installed Docker on Windows-10 along with Docker Tool Box. I have created a small Spring Web application and I want to run this application using Liberty profile.

I have built the docker image using below docker file.

FROM ibmjava:8-jre


RUN apt-get update \
        && apt-get install -y --no-install-recommends unzip \
        && rm -rf /var/lib/apt/lists/*

# Install WebSphere Liberty
ENV LIBERTY_VERSION 16.0.0_04


ARG LIBERTY_URL

ARG DOWNLOAD_OPTIONS=""

RUN LIBERTY_URL=${LIBERTY_URL:-$(wget -q -O - https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/index.yml  | grep $LIBERTY_VERSION -A 6 | sed -n 's/\s*kernel:\s//p' | tr -d '\r' )}  \
        && wget $DOWNLOAD_OPTIONS $LIBERTY_URL -U UA-IBM-WebSphere-Liberty-Docker -O /tmp/wlp.zip \
        && unzip -q /tmp/wlp.zip -d /opt/ibm \
        && rm /tmp/wlp.zip

ENV PATH=/opt/ibm/wlp/bin:$PATH

# Set Path Shortcuts
ENV LOG_DIR=/logs \
        WLP_OUTPUT_DIR=/opt/ibm/wlp/output

RUN mkdir /logs \
        && ln -s $WLP_OUTPUT_DIR/defaultServer /output \
        && ln -s /opt/ibm/wlp/usr/servers/defaultServer /config

# Configure WebSphere Liberty

RUN /opt/ibm/wlp/bin/server create \
        && rm -rf $WLP_OUTPUT_DIR/.classCache /output/workarea

#COPY docker-server /opt/ibm/docker/

EXPOSE 9080 9443

CMD ["/opt/ibm/docker/docker-server", "run", "defaultServer"]
1

There are 1 best solutions below

0
On BEST ANSWER

You need to un-comment the COPY docker-server /opt/ibm/docker/ line, then it'll work as expected.