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

Publishing OracleWebCenterPortal DockerScripts #1777

Merged
merged 3 commits into from
Nov 12, 2020

Conversation

anandsirasagi
Copy link
Contributor

Signed-off-by: asirasag [email protected]


```
# create Admin Container
$ docker run -i -t --name WCPAdminContainer --network=WCPortalNET -p 7001:7001 -v /scratch/wcpdocker/volumes/wcpportal:/u01/oracle/user_projects --env-file /scratch/<userid>/docker/webcenter.env.list oracle/wcportal:12.2.1.4.0 /bin/bash -c "/u01/oracle/container-scripts/configureOrStartAdminServer.sh; /bin/bash"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove /bin/bash at least, but everything after the image name should really be removed.

$ docker run -i -t --name WCPAdminContainer --network=WCPortalNET -p 7001:7001 -v /scratch/wcpdocker/volumes/wcpportal:/u01/oracle/user_projects --env-file /scratch/<userid>/docker/webcenter.env.list oracle/wcportal:12.2.1.4.0 /bin/bash -c "/u01/oracle/container-scripts/configureOrStartAdminServer.sh; /bin/bash"

# create Portal Container
$ docker run -i -t --name WCPortalContainer --network=WCPortalNET -p 8888:8888 -v /scratch/wcpdocker/volumes/wcpportal:/u01/oracle/user_projects --env-file /scratch/<userid>/docker/webcenter.env.list oracle/wcportal:12.2.1.4.0 /bin/bash -c "/u01/oracle/container-scripts/configureOrStartWebCenterPortal.sh; /bin/bash"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove /bin/bash at least, but everything after the image name should really be removed.

$ docker run -i -t --name WCPortalContainer --network=WCPortalNET -p 8888:8888 -v /scratch/wcpdocker/volumes/wcpportal:/u01/oracle/user_projects --env-file /scratch/<userid>/docker/webcenter.env.list oracle/wcportal:12.2.1.4.0 /bin/bash -c "/u01/oracle/container-scripts/configureOrStartWebCenterPortal.sh; /bin/bash"

# create Elasticsearch Container
$ docker run -i -t --name ESContainer --network=WCPortalNET -p 9200:9200 --volumes-from WCPortalContainer -v /scratch/wcpdocker/volumes/es:/u01/esHome/esNode/data --env-file /scratch/<userid>/docker/webcenter.env.list oracle/wcportal:12.2.1.4.0 /bin/bash -c "/u01/oracle/container-scripts/configureOrStartElasticsearch.sh; /bin/bash"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove /bin/bash at least, but everything after the image name should really be removed.

@anandsirasagi
Copy link
Contributor Author

Hi @Djelibeybi

Please review the changes.

Copy link
Member

@Djelibeybi Djelibeybi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: you seem to have three different components all contained in a single image: the Admin Server, the WebCenter Portal and Elasticsearch.

Why do these not each have their own container image so that each one can be customised individually? Wouldn't having just one product per image make the overall image size smaller too?

@@ -153,7 +100,7 @@ $ docker container start -i WCPAdminContainer
Run the following command to create the Portal Managed Server container:

```
$ docker run -i -t --name WCPortalContainer --network=WCPortalNET -p <Any Free Port>:$MANAGED_SERVER_PORT -v $DATA_VOLUME:/u01/oracle/user_projects --env-file <directory>/webcenter.env.list $WCPortalImageName /bin/bash -c "/u01/oracle/container-scripts/configureOrStartWebCenterPortal.sh; /bin/bash"
$ docker run -i -t --name WCPortalContainer --network=WCPortalNET -p <Any Free Port>:$MANAGED_SERVER_PORT -v $DATA_VOLUME:/u01/oracle/user_projects --env-file <directory>/webcenter.env.list $WCPortalImageName configureOrStartWebCenterPortal.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're still calling configureOrStartWebCenterPortal.sh manually here. This may not work on an orchestration platform like Kubernetes or Mesosphere. Can you not switch to using an environment variable to determine whether the container should start an admin server or the portal? Better yet, being able to automatically determine whether an admin server is already running would be great.

@@ -193,7 +140,7 @@ $ sudo chown 1000:1000 /scratch/wcpdocker/volumes/es
#### B. Creating and Running Elasticsearch Container

```
$ docker run -i -t --name ESContainer --network=WCPortalNET -p 9200:9200 --volumes-from WCPortalContainer -v $ES_DATA_VOLUME:/u01/esHome/esNode/data --env-file <directory>/webcenter.env.list $WCPortalImageName /bin/bash -c "/u01/oracle/container-scripts/configureOrStartElasticsearch.sh; /bin/bash"
$ docker run -i -t --name ESContainer --network=WCPortalNET -p 9200:9200 --volumes-from WCPortalContainer -v $ES_DATA_VOLUME:/u01/esHome/esNode/data --env-file <directory>/webcenter.env.list $WCPortalImageName configureOrStartElasticsearch.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, you're now starting Elasticsearch manually.

@anandsirasagi
Copy link
Contributor Author

All the components are part of the same product and present in same middleware home, from maintainability and patching perspective , all of them are in the same image

@Djelibeybi
Copy link
Member

Djelibeybi commented Nov 12, 2020

All the components are part of the same product and present in same middleware home, from maintainability and patching perspective , all of them are in the same image

Fair enough. I'm sure that's great for standard installs, but it does make the container deployment more difficult because instead of having an image per component, you have to decide at runtime which component to start. It also makes the resulting container footprint larger.

It would still be good to somehow automate the component activation for the user instead of relying on them to overload the CMD directive for you.

@anandsirasagi
Copy link
Contributor Author

The only way we can achieve automatic startup without overriding was to mention which container to start in env file while running docker images. But this approach is not preferable that's why we are going with overriding with CMD

@Djelibeybi
Copy link
Member

Fair enough.

@Djelibeybi Djelibeybi merged commit d58e9a0 into oracle:master Nov 12, 2020
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

Successfully merging this pull request may close these issues.

2 participants