Permission denied Wso2 docker volume

1

Hi, I'm mounting a docker container for the wso2Ei and I'm having Denied Permission error.

My docker file is this:

# ------------------------------------------------------------------------
#
# Copyright 2017 WSO2, Inc. (http://wso2.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License
#
# ------------------------------------------------------------------------

# set to latest Ubuntu LTS
FROM ubuntu:16.04
MAINTAINER WSO2 Docker Maintainers "[email protected]"

# set user configurations
ARG USER=wso2carbon
ARG USER_ID=802
ARG USER_GROUP=wso2
ARG USER_GROUP_ID=802
ARG USER_HOME=/home/${USER}
# set dependant files directory
ARG FILES=./files
# set wso2 product configurations
ARG WSO2_SERVER=wso2ei
ARG WSO2_SERVER_VERSION=6.2.0
ARG WSO2_SERVER_DIST=${WSO2_SERVER}-${WSO2_SERVER_VERSION}
ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER}
# set jdk configurations
ARG JDK_DIST=jdk1.8.0*
ARG JAVA_HOME=${USER_HOME}/java

# install required packages
RUN echo "deb http://192.168.10.18/ubuntu xenial main restricted universe multiverse" > /etc/apt/sources.list
RUN echo "deb http://192.168.10.18/ubuntu xenial-security main restricted universe multiverse" >> /etc/apt/sources.list
RUN echo "deb http://192.168.10.18/ubuntu xenial-updates main restricted universe multiverse" >> /etc/apt/sources.list
RUN echo "deb http://192.168.10.18/ubuntu xenial-proposed main restricted universe multiverse" >> /etc/apt/sources.list
RUN echo "deb http://192.168.10.18/ubuntu xenial-backports main restricted universe multiverse" >> /etc/apt/sources.list

RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
    unzip telnet iproute2 curl && \
    rm -rf /var/lib/apt/lists/*

# create a user group and a user
RUN groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} && \
    useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER}

# copy the jdk and wso2 product distributions to user's home directory
COPY ${FILES}/${JDK_DIST} ${JAVA_HOME}
COPY ${FILES}/${WSO2_SERVER_DIST} ${WSO2_SERVER_HOME}
RUN chown -R wso2carbon:wso2  ${JAVA_HOME}
RUN chown -R wso2carbon:wso2  ${WSO2_SERVER_HOME}   

#COPY --chown=wso2carbon:wso2 ${FILES}/${JDK_DIST} ${JAVA_HOME}
#COPY --chown=wso2carbon:wso2 ${FILES}/${WSO2_SERVER_DIST} ${WSO2_SERVER_HOME}

# set the user and work directory
USER ${USER}
WORKDIR ${USER_HOME}

# set environment variables
ENV JAVA_HOME=${JAVA_HOME} \
    PATH=$JAVA_HOME/bin:$PATH \
    WSO2_SERVER_HOME=${WSO2_SERVER_HOME}    

# expose integrator ports
EXPOSE 8280 8243 9443

# set entrypoint to integrator startup script
ENTRYPOINT ${WSO2_SERVER_HOME}/bin/integrator.sh

and the run command that I run to create the container is this

docker run -it -p 8243:8243 -p 8280:8280 -p 9443:9443 -v /home/integro/ei/bin/:/home/wso2carbon/wso2ei/bin --name wso2ei wso2ei:6.2.0

When docker creates the container but gives this error

/bin/sh: 1: /home/wso2carbon/wso2ei/bin/integrator.sh: Permission denied

but if I remove the volume I do not get an error

    
asked by Julio César Paredes Rodriguez 10.05.2018 в 14:52
source

1 answer

0

It must be a problem of permissions in the local folder of your pc to which you are mapping, from the terminal check the permissions of your folder with ls -l /home/integro/ei/ and look at the permissions of the folder bin , the other thing you can do is give everyone permission in the local folder with sudo chmod -R 777 /home/integro/ei/bin/ EYE: ONLY FOR TEST since the 777 permissions should not be in any folder.

    
answered by 11.05.2018 / 16:15
source