Docker run failed for apim analytics image with illegal option

In this post I am going to share my experience for running the docker image of wso2 apim analytics dashboard that caused some issue while running it. Below is the summary of the same-

Environment: Windows, RHEL 8.3, WSO2 Analytics 3.2.0
Problem: While executing docker run command, it gives following error-

sudo docker run wso2am-analytics-dashboard:3.2.0.20
: not foundarbon/docker-entrypoint.sh: 17:
/home/wso2carbon/docker-entrypoint.sh: 18: set: Illegal option -

Cause: 
The problem occurred due to dos2unix conversion issue. Basically the file docker-entrypoint.sh was created in a winodws machine in notepad++ utility but remained with EOL conversion as Windows (CR LF). Further this file was uploaded to a linux machine where actual execution has to be done.

Solution
We need to change the EOL conversion of the file (docker-entrypoint.sh) to Linux (LR) prior to docker image creation. I have used windows environment and notepad++ utility to do the same as-
1. Open the file docker-entrypoint.sh in notepad++
2. Go to edit menu option
3. Select EOL conversion
4. Select Linux (LR)
5. Save the file and package your docker image again with this updated file.

Below is the screenshot for the same-


This has solved the problem and I was able to run the docker image successfully.

Comments

Popular posts from this blog

Oracle SOA Suite- Implementing Email Notification

Oracle SOA Suite 12c- PKIX path building failed & unable to find valid certification path to requested target

Migration of Oracle SOA Suite Composite from 11g to 12c