WSO2 APIM Custom Docker Image Run - Permission Denied

Problem Statement
Recently I have been trying to build a custom docker image for WSO2 APIM v3.2.0 where I have customised the package and re-built the image using the updated package. Below is the directory structure -

ProjectDirectory
-Dockerfile
-docker-entrypoint.sh
-wso2am_3.2.0.zip

I ran the command to build the image as
$ docker build -t wso2am:3.2.0_01 .

Image built successfully and visible as-
$ docker images
REPOSITORY        TAG       IMAGE_ID     CREATED         SIZE
loclahost/wso2am  3.2.0_01  4bg83jd9abg1 2 minutes ago   1.42 GB

When I try to run the contianer of respective docker image, it throws error-

$ docker run -it -p 8280:8280 -p 9443:9443 --name apimanager wso2am:3.2.0_01

Error contianer_linux.go 370: starting container process caused: exec: "/home/wso2carbon/docker-entrypoint.sh": permission denied: OCI runtime permission denied error

Cause
There was a permission issue in execution of docker-entrypoint.sh file

Solution
1. Add an execution permission to docker-entrypoint.sh in Dockerfile just above the ENTRYPOINT snippet as shown below

RUN ["chmod", "+x", "/home/wso2carbon/docker-entrypoint.sh"]

2. Re-build the docker image and run as earlier. It should now run as expected

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