Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when restarting docker container with profiles active #473

Open
diogopruch opened this issue Oct 23, 2022 · 0 comments
Open

Error when restarting docker container with profiles active #473

diogopruch opened this issue Oct 23, 2022 · 0 comments

Comments

@diogopruch
Copy link

Description:

For the first image build and and container run with the the environment variable PROFILE_NAME=control-plane or PROFILE_NAME=gateway-worker it works ok. However when the container is restarted, an error occurs because the script sh ${WSO2_SERVER_HOME}/bin/profileSetup.sh -Dprofile=${PROFILE_NAME} is executed again.

I solved this problem, removing the lines from docker-entrypoint.sh files:

# optimize WSO2 Carbon Server, if the profile name is defined as an environment variable
if [[ ! -z "${PROFILE_NAME}" ]]
then
  echo "Optimizing WSO2 Carbon Server" >&2
  sh ${WSO2_SERVER_HOME}/bin/profileSetup.sh -Dprofile=${PROFILE_NAME}
fi

Adding the lines to the Dockerfile files:

# optimize WSO2 Carbon Server, if the profile name is defined as an environment variable
ARG PROFILE_NAME
ENV PROFILE_NAME=${PROFILE_NAME}
RUN if [ ! -z "$PROFILE_NAME" ] ; then sh ${WSO2_SERVER_HOME}/bin/profileSetup.sh -Dprofile=${PROFILE_NAME} ; fi

And executing the build with arguments instead of ENV variable:

docker build --build-arg PROFILE_NAME=control-plane

Suggested Labels:

Suggested Assignees:

Affected Product Version:

Docker container wso2am-4.1.0

Steps to reproduce:

Restart a docker container with ENV variable PROFILE_NAME=control-plane or PROFILE_NAME=gateway-worker

Related Issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant