Skip to content

Issue#130 add docker sample that creates a domain #131

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

Merged
merged 20 commits into from
Jul 2, 2018

Conversation

rakillen
Copy link
Member

add docker sample that creates a domain. Fixes #130

Copy link
Member

@mriccell mriccell left a comment

Choose a reason for hiding this comment

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

Richard I have made an initial review, please let me know if you have any questions.

if [ -n "$WDT_MODEL" ]; then MODEL_OPT="-model_file /u01/$WDT_MODEL"; fi && \
if [ -n "$WDT_ARCHIVE" ]; then ARCHIVE_OPT="-archive_file /u01/$WDT_ARCHIVE"; fi && \
/u01/weblogic-deploy/bin/createDomain.sh \
-oracle_home /u01/oracle \
Copy link
Member

Choose a reason for hiding this comment

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

Use the ORACLE_HOME env

/u01/weblogic-deploy/bin/createDomain.sh \
-oracle_home /u01/oracle \
-java_home ${JAVA_HOME} \
-domain_parent /u01/oracle/user_projects/domains \
Copy link
Member

Choose a reason for hiding this comment

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

Use a DOMAIN_HOME env

@@ -0,0 +1,50 @@
Example Image with a WLS Domain
================================
This Dockerfile extends the Oracle WebLogic image by creating a sample WLS 12.2.1.3 domain and cluster from a WebLogic Deploy Tool model.
Copy link
Member

Choose a reason for hiding this comment

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

The official name is Oracle WebLogic Deploy Tooling (WDT). Can you add a link to the GitHub project since it will be in the docker-images sample project.


### WebLogic Deploy Tool

The WebLogic Deploy Tool is used to create the domain image from a model file. Details about the tool and the model file format can be found in its GitHub project:
Copy link
Member

Choose a reason for hiding this comment

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

Give an example instead of differing to WDT project. You might want to say that a user can discover using WDT a preexisting domain which produces a yaml that captures the configuration. This yaml can be changed to specify specific configuration parameters and then the create script of WDT is used to create the domain inside the image.


### How to Build and Run

**NOTE:** The image is based on a WebLogic image in the Docker store: store/oracle/weblogic:12.2.1.3 . Verify that you have access to download this image.
Copy link
Member

Choose a reason for hiding this comment

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

download this image to your local repository.


$ docker run -d --name MS1 --link wlsadmin:wlsadmin -p 8001:8001 --env-file ./container-scripts/domain.properties -e ADMIN_PASSWORD=<admin_password> -e MS_NAME=MS1 --volumes-from wlsadmin 12213-domain createServer.sh

TBD To start a second Managed Server (MS2), run:
Copy link
Member

Choose a reason for hiding this comment

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

TBD, why?

Copy link
Member Author

Choose a reason for hiding this comment

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

I haven't implemented the server start scripts yet. Would you rather just take these sections out until that is in place?

Copy link
Member

Choose a reason for hiding this comment

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

Why would the script to start MS1 different than the script to start MS2?

Copy link
Member

Choose a reason for hiding this comment

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

Oh I see so you do not have scripts to start MS1 or MS2, no this is fine since we will not commit to docker-images until everything is ready.


$ docker run -d --name MS2 --link wlsadmin:wlsadmin -p 8002:8001 --env-file ./container-scripts/domain.properties -e ADMIN_PASSWORD=<admin_password> -e MS_NAME=MS2 --volumes-from wlsadmin 12213-domain createServer.sh

The above scenario from this sample will give you a WebLogic domain with a cluster set up on a single host environment.
Copy link
Member

Choose a reason for hiding this comment

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

is the cluster a configure cluster a dynamic cluster or it does not matter?

Copy link
Member

Choose a reason for hiding this comment

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

I'd like it to be a dynamic cluster, if possible.

Copy link
Member Author

Choose a reason for hiding this comment

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

Currently just a configure cluster. Plan to make this a dynamic cluster when server scripts are ready.

#
#Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#
docker build \
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, that looks pretty straightforward. Let me know if he wants to do this.

@@ -0,0 +1,2 @@
ADMIN_PORT=7001
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need this domain.properties if you have a simple-properties.yaml and can define the defaults in the Dockerfile

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't currently use this for the admin startup script, not sure if we will need for the server scripts. One problem is that we can't easily extract the values we want from the yaml model file. I'll know more once we have startup scripts.

#
# - wget https://github.com/oracle/weblogic-deploy-tooling/releases/download/weblogic-deploy-tooling-0.11/weblogic-deploy.zip
#
weblogic-deploy.zip
Copy link
Member

Choose a reason for hiding this comment

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

Is there a checksum for this zip?

Copy link
Member

Choose a reason for hiding this comment

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

Github doesn't appear to offer checksum capabilities. We could put something in the release notes, but seems kinda odd.

# -----------------------
# Put all downloaded files in the same directory as this Dockerfile
# Run:
# $ sudo docker build \
Copy link
Member

Choose a reason for hiding this comment

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

We should tell customers where to put application binaries.

Copy link
Member

Choose a reason for hiding this comment

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

Or... make it clear that these should be included with the application model?

================================
This Dockerfile extends the Oracle WebLogic image by creating a sample WLS 12.2.1.3 domain and cluster from a WebLogic Deploy Tool model.

Utility scripts are copied into the image, enabling users to plug Node Manager automatically into the Administration Server running on another container.
Copy link
Member

Choose a reason for hiding this comment

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

This is more a question, since I'm hoping to see them below, but... What are these scripts and what exactly do they do?


$ docker run -d --name MS2 --link wlsadmin:wlsadmin -p 8002:8001 --env-file ./container-scripts/domain.properties -e ADMIN_PASSWORD=<admin_password> -e MS_NAME=MS2 --volumes-from wlsadmin 12213-domain createServer.sh

The above scenario from this sample will give you a WebLogic domain with a cluster set up on a single host environment.
Copy link
Member

Choose a reason for hiding this comment

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

I'd like it to be a dynamic cluster, if possible.


# Start Admin Server and tail the logs
${DOMAIN_HOME}/startWebLogic.sh
touch ${DOMAIN_HOME}/servers/AdminServer/logs/AdminServer.log
Copy link
Member

Choose a reason for hiding this comment

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

We should discuss this as for K8s we're going to want the logs relocated outside the domain home to a file-system location where a persistent volume is mounted.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is planned to have a dynamic cluster, still working on that. I think the log directory can be moved to persistent volume.

Copy link
Member

Choose a reason for hiding this comment

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

this statement does not preclude the logs being outside. The mechanism in Docker -v is used to map the logs outside of the container.

@tbarnes-us
Copy link

tbarnes-us commented Jun 25, 2018

This looks good to me. My only comment is that we may want to note that a domain-in-image's image needs to be protected with the same level of care as a stand-alone domain-home, since it contains sufficient information to decrypt WL passwords (the domain secret/SerializedSystemIni.dat). Derek, Monica, and I have discussed in more detail via Slack...

ddsharpe
ddsharpe previously approved these changes Jun 27, 2018
@rakillen rakillen merged commit 05944bb into master Jul 2, 2018
@rakillen rakillen deleted the issue#130-add-docker-sample-that-creates-a-domain branch July 3, 2018 21:25
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.

5 participants