1. Introduction
8. FAQs
9. Copyright
To create web content management solutions, developers need a lightweight environment. Docker images need minimum resources, thereby allowing developers to quickly create development environments.
This project offers scripts to build an Oracle WebCenter Sites image based on 12c R2 (12.2.1.3). Use this Docker configuration to facilitate installation, configuration, and environment setup for DevOps users. For more information about Oracle WebCenter Sites, see the Oracle WebCenter Sites Online Documentation.
This project creates Oracle WebCenter Sites Docker image with a single node targeted for development and testing, and excludes components such as SatelliteServer, SiteCapture, and VisitorServices. This image is supported as per Oracle Support Note 2017945.1.
Oracle WebCenter Sites has been tested and is known to run on the following hardware and software:
Hardware | Size |
---|---|
RAM | 16GB |
Disk Space | 200GB+ |
Version | Command to verify version | |
---|---|---|
OS | Oracle Linux 7.3 or higher | more /etc/oracle-release |
Docker | Docker version 17.03 or higher | docker –version |
Before you begin, ensure to do the following steps:
-
Use Oracle Linux Server. Download from this location: http://www.oracle.com/technetwork/server-storage/linux/downloads/index.html.
-
Set the Proxy if required.
-
To confirm that userid is part of the Docker group, run the below command:
$ id -Gn <userid>
- Run 'docker ps -a' command to confirm user is able to connect to Docker engine.
Note: To add/modify user to be part of docker group, see FAQ section.
Before you begin creating an Oracle WebCenter Sites image on Docker, download the following images of Oracle Fusion Middleware Infrastructure, Oracle Database, and Oracle WebCenter Sites binaries. WebCenter Sites is installed on Oracle Fusion Middleware infrastructure, and it needs Oracle Database for storage.
To download images from Oracle Container Registry (OCR) and Oracle Technology Network (OTN):
Sign in to Oracle Container Registry. Click the Sign in link that's on the top-right of the Web page.
-
Click Middleware and then click Continue for the fmw-infrastructure repository.
-
Click Accept to accept the license agreement.
-
To download Oracle Fusion Middleware infrastructure base image:
$ docker pull container-registry.oracle.com/middleware/fmw-infrastructure:12.2.1.3
Retag the Oracle Fusion Middleware Infrastructure Docker image by running the following command:
$ docker tag container-registry.oracle.com/middleware/fmw-infrastructure:12.2.1.3 oracle/fmw-infrastructure:12.2.1.3
Note:
-
Click Database and then click Continue for enterprise repository.
-
Click Accept to accept the license agreement.
-
From the terminal, execute the following commands:
Download Oracle Database 12.2.0.1 base image:
$ docker pull container-registry.oracle.com/database/enterprise:12.2.0.1
Retag the Oracle Database Docker image by running the following command:
$ docker tag container-registry.oracle.com/database/enterprise:12.2.0.1 database/enterprise:12.2.0.1
Note:
- Clone or download the GitHub repository. The repository contains Docker files and scripts to build Docker images for Oracle products.
- Download Oracle WebCenter Sites 12c R2 12.2.1.3 binary from Oracle Technology Network.
- Save the Oracle WebCenter Sites 12.2.1.3 binary into the cloned repository folder located at:
../docker-images/OracleWebCenterSites/dockerfiles/12.2.1.3/
.
To build Oracle WebCenter Sites Docker image, go to folder located at ../docker-images/OracleWebCenterSites/dockerfiles/
and run the following command:
$ sh buildDockerImage.sh -v 12.2.1.3
For more information on usage of buildDockerImage.sh command, see FAQ,
IMPORTANT: The resulting image has automated scripts to:
- Run RCU
- Create and configure a WebLogic domain
- Run WebCenter Sites Configuration process while creating an admin container
Configure an environment before running the Oracle WebCenter Sites Docker container. You need to set up a communication network between containers on the same host, data volume to store data, and Database container.
Create a user-defined network to enable containers to communicate by running the following command:
$ docker network create -d bridge <network_name>
Sample command:
$ docker network create -d bridge WCSitesNet
You need to mount volumes, which are directories stored outside a container's file system, to store database data files and WebLogic domain files. The default location of the volume in the container is /var/lib/docker/volumes
.
This option lets you mount a directory from your host to a container as volume. This volume is used to store database data files and WebLogic server domain files. The volume is created at this location /scratch/WCSitesVolume/
.
To mount a host directory as a data volume, execute the below command.
The userid can be anything but it must belong to uid:guid as 1000:1000, which is same as 'oracle' user running in the container. This ensures 'oracle' user has access to shared volume.
$ sudo /usr/sbin/useradd -u 1000 -g 1000 <new_userid>
$ mkdir -p /scratch/WCSitesVolume/WCSites /scratch/WCSitesVolume/WCSitesShared
$ sudo chown 1000:1000 /scratch/WCSitesVolume/WCSites /scratch/WCSitesVolume/WCSitesShared
All container operations are performed as 'oracle' user. Note: If a user already exist with '-u 1000 -g 1000' then use the same user. Or modify any existing user to have uid-gid as '-u 1000 -g 1000'
To set up an Oracle Database Docker container, you must first update the environment file which is passed as a parameter in the command that starts the database container.
Update the environment db.env.list
file, to define the parameters, which is located at ../docker-images/OracleWebCenterSites/dockerfiles/
.
db.env.list
file details:
DB_SID=ORCLCDB
DB_PDB=ORCLPDB1
DB_DOMAIN=localdomain
To run Database container, go to folder where db.env.list
file is located at ../docker-images/OracleWebCenterSites/dockerfiles/
and run the following command:
$ docker run -d --name <container_name> --network=<network_name> -p <database_listener_port>:1521 -p <enterprise_manager_port>:5500 --env-file <environment_file> <repo_name:tag_name>
Sample command:
$ docker run -d --name WCSites12212Database --network=WCSitesNet -p 1521:1521 -p 5500:5500 --env-file ./db.env.list database/enterprise:12.2.0.1
Database start up command explained:
Parameter | Parameter Name | Description |
---|---|---|
--name | container_name | Database name; set to ‘WCSites12212Database’ |
--network | network_name | User-defined network to connect to; use the one created earlier ‘WCSitesNet’ |
-p | database_listener_port | Database listener port; set to ‘1521’. Maps the container port to host's port. |
-p | enterprise_manager_port | Enterprise Manager port; set to ‘5500’. Maps the container port to host's port. |
database/enterprise:12.2.0.1-ee | repo_name:tag_name | Repository name, Tag name of the image. |
For monitoring Docker container Logs:
$ docker logs -f --tail 900 WCSites12212Database
Running the above command creates a Container Database (CDB) with one Pluggable Database (PDB).
This is the Database connection string:
DB_CONNECTSTRING=<hostname/containername>:1521/ORCLPDB1.localdomain
Note: Container name can be given only if the container is located on the same host machine. Ensure SERVICE_NAME is a valid PDB service name in your database as given in the $ORACLE_HOME/admin/ORCLCDB/tnsnames.ora file.
For Additional information like default database password refer https://container-registry.oracle.com, Click Home > Database > enterprise.
To run the Oracle WebCenter Sites Docker container, you need to create:
- Admin container to manage the admin server. The admin container performs RCU, ConfigWizard, and WebCenter Sites Configuration processes.
- Managed container to manage the managed server.
This container is used to manage Admin Server.
wcsitesadminserver.env.list
is located at ../docker-images/OracleWebCenterSites/dockerfiles/
that contains parameters that are passed to WebLogic admin server. Update this file with the information pertinent to your environment:
wcsitesadminserver.env.list
file details:
DOCKER_HOST=<IP or Hostname of Docker Host. Should not use 'localhost' as IP or hostname of docker host.>
DB_CONNECTSTRING=<Hostname/ContainerName>:<Database Port>/<DB_PDB>.<DB_DOMAIN>
DB_USER=<By default: sys>
DB_PASSWORD=<Database Password>
RCU_PREFIX=<RCU_PREFIX>
DB_SCHEMA_PASSWORD=<database_schema_password: if not provided, it gets auto generated>
SAMPLES=<To install sample Sites, set samples as true, else set as false>
DOMAIN_NAME=<Weblogic Domain Name optional>
SITES_SERVER_NAME=<Sites Server Name optional>
ADMIN_USERNAME=<Weblogic Admin UserName, default: weblogic>
ADMIN_PASSWORD=<Weblogic Admin Password: if not provided, it gets auto generated>
SITES_ADMIN_USERNAME=<Sites Admin UserName, default: ContentServer>
SITES_ADMIN_PASSWORD=<Sites Admin Password: if not provided, it gets auto generated>
SITES_APP_USERNAME=<Sites Application UserName, default: fwadmin>
SITES_APP_PASSWORD=<Sites Application Password: if not provided, it gets auto generated>
SITES_SS_USERNAME=<Sites SatelliteServer UserName, default: SatelliteServer>
SITES_SS_PASSWORD=<Sites SatelliteServer Password: if not provided, it gets auto generated>
a. To run WebLogic Admin server container, go to folder where wcsitesadminserver.env.list
file is located at ../docker-images/OracleWebCenterSites/dockerfiles/
.
b. Run the following command and pass the environment file name as a parameter:
$ docker run -d --name <container_name> --network=<network_name> -p <weblogic_port>:7001 -p <weblogic_ssl_port>:9001 -v <user_projects_volume_dir>:/u01/oracle/user_projects -v <sites_shared_volume_dir>:/u01/oracle/sites-shared --env-file <environment_file> <repo_name:tag_name>
Sample command:
$ docker run -d --name WCSitesAdminContainer --network=WCSitesNet -p 7001:7001 -p 9001:9001 -v /scratch/WCSitesVolume/WCSites:/u01/oracle/user_projects -v /scratch/WCSitesVolume/WCSitesShared:/u01/oracle/sites-shared --env-file ./wcsitesadminserver.env.list oracle/wcsites:12.2.1.3
Admin Container start up command explained:
Parameter | Parameter Name | Description |
---|---|---|
--name | container_name | Database name; set to ‘WCSitesAdminContainer’ |
--network | network_name | User-defined network to connect to; use the one created earlier ‘WCSitesNet’. |
-p | weblogic_port | WebLogic port; set to ‘7001’. Maps the container port to host's port. |
-p | weblogic_ssl_port | WebLogic SSL port; set to ‘9001’. Maps the container port to host's port. |
--v | user_projects_volume_dir | ‘/scratch/WCSitesVolume/WCSites’ mounts the host directory as a Volume. |
--v | sites_shared_volume_dir | ‘/scratch/WCSitesVolume/WCSitesShared’ mounts the host directory as a Volume. |
--env-file | environment_file | ‘wcsitesadminserver.env.list’ sets the environment variables. |
oracle/wcsites:12.2.1.3 | repo_name:tag_name | Repository name, Tag name of the image. |
For monitoring Docker container Logs:
$ docker logs -f --tail 900 WCSitesAdminContainer
IMPORTANT: Monitor the container logs to see below message. Also check if the WebLogic Admin server starts up and tails the log before logging in to the Console.
Admin server running, ready to start Managed server
Sites Installation completed in xxxx seconds.
--------------------------------------------
Note: Copy the WebLogic Admin, Database Schema and Sites passwords from the log. It's recommended to reset all autogenerated passwords.
To reset Sites autogenerated passwords after starting Managed container, see FAQ
To connect to the container for monitoring WebCenter Sites/WebLogic Logs:
$ docker exec -it WCSitesAdminContainer /bin/bash
Now you can access below WebLogic Console.
http://DOCKER_HOST:7001/console
This container is used to manage the Managed Server.
Update the environment wcsitesserver.env.list
file which is located at ../docker-images/OracleWebCenterSites/dockerfiles/
.
wcsitesserver.env.list
file details:
WCSITES_ADMIN_HOSTNAME=<WCSites Admin Container Name>
DOMAIN_NAME=<Weblogic_Domain Name>
SITES_SERVER_NAME=<Sites Server Name>
a. To run WebLogic Managed Server container, go to folder where wcsitesserver.env.list
file is located at ../docker-images/OracleWebCenterSites/dockerfiles/
.
b. Run the following command and pass the environment file name as a parameter:
$ docker run -d -t --name <container_name> --network=<network_name> --volumes-from <admin_container_name> -p <sites_port>:7002 -p <sites_ssl_port>:9002 --env-file <environment_file> <repo_name:tag_name> /bin/bash -c "/u01/oracle/sites-container-scripts/startSitesServer.sh; /bin/bash"
Sample command:
$ docker run -d -t --name WCSitesManagedContainer --network=WCSitesNet --volumes-from WCSitesAdminContainer -p 7002:7002 -p 9002:9002 --env-file ./wcsitesserver.env.list oracle/wcsites:12.2.1.3 /bin/bash -c "/u01/oracle/sites-container-scripts/startSitesServer.sh; /bin/bash"
Managed Container start up command explained:
Parameter | Parameter Name | Description |
---|---|---|
--name | container_name | Database name; set to ‘WCSitesManagedContainer’ |
--network | network_name | User-defined network to connect to; use the one created earlier ‘WCSitesNet’. |
-p | sites_port | Sites port; set to ‘7002’. Maps the container port to host’s port. |
-p | sites_ssl_port | Sites SSL port; set to ‘9002’. Maps the container port to host’s port. |
--volumes-from | admin_container_name | ‘WCSitesAdminContainer’ mounts the directory from Admin container. |
--env-file | environment_file | ‘wcsitesadminserver.env.list’ sets the environment variables. |
oracle/wcsites:12.2.1.3 | repo_name:tag_name | Repository name, Tag name of the image. |
IMPORTANT: Monitor the container logs to check if WebCenter Sites starts up before logging in to the Console. To monitor Docker Container logs:
$ docker logs -f --tail 900 WCSitesManagedContainer
Admin server running, ready to start Managed server
Note: It's recommended to reset Sites passwords after starting Managed container, see FAQ
To connect to the container for monitoring WebCenter Sites/WebLogic logs:
$ docker exec -it WCSitesManagedContainer /bin/bash
Now you can access WebCenter Sites Server at
http://DOCKER_HOST:7002/sites
$ sh buildDockerImage.sh
Usage: buildDockerImage.sh -v [version]
Builds a Docker Image for Oracle WebCenter Sites.
Parameters:
-v: version to build. Required.
Choose: 12.2.1.x
-c: enables Docker image layer cache during build
-s: skips the MD5 check of packages
LICENSE UPL 1.0
Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved.
2. Where do I find the auto-generated WebLogic Administrator, Database schema, Oracle WebCenter Sites [Administrator,Application,SatelliteServer] passwords?
If you do not specify WebLogic/Database/Sites username and password, a password is auto-generated.
You can find only auto-generated password in the Admin Container log.
If you need to find the passwords later, look for password in the Docker logs generated during the startup of the container.
To view the Docker Container logs run:
$ docker logs --details <Admin-Container-Id>
See [How to Reset a WebCenter Sites Password] (https://docs.oracle.com/middleware/1221/wcs/admin/GUID-BECECCFD-0EAF-4157-B23D-6CBD4F3BDEE9.htm#WBCSA8419)
You can find these scripts here: dockerfiles/12.2.1.3/sites-container-scripts) sites-container-scripts are located at ../docker-images/OracleWebCenterSites/dockerfiles/12.2.1.3/sites-container-scripts/*
Most likely, you're not running this command for the first time. The RCU_prefix may be present already. Drop the corresponding schemas or use a different prefix.
See Readme.md located at ../docker-images/OracleWebCenterSites/dockerfiles/12.2.1.3/wcs-wls-docker-install/README.md
Set DB_CONNECTSTRING connection string parameter as mentioned in section Update the environment file.
8. Alternate download location for Oracle Fusion Middleware Infrastructure and Oracle Database Images?
Before you build an Oracle WebCenter Sites image, download the Oracle Fusion Middleware infrastructure and Oracle Database images from the Docker Store.
If you download Oracle Fusion Middleware infrastructure from Docker Store, then retag using below command:
$ docker tag store/oracle/fmw-infrastructure:12.2.1.3 oracle/fmw-infrastructure:12.2.1.3
If you download Oracle Database from Docker Store, then retag using below command:
$ docker tag store/oracle/database-enterprise:12.2.0.1 database/enterprise:12.2.0.1
If you want to build your own Oracle Database image, use the Docker files and scripts in the Oracle Database GitHub repository.
If you want to build your own Oracle Fusion Middleware Infrastructure image, use the Docker files and scripts in the Oracle FMW Infrastructure GitHub repository.
The errors mean that the host is not able to connect to external registries for update. To access external registries and build a Docker image, set up environment variables for proxy server as below:
export http_proxy=http://www-yourcompany.com:80
export https_proxy=http://www-yourcompany.com:80
export HTTP_PROXY=http://www-yourcompany.com:80
export HTTPS_PROXY=http://www-yourcompany.com:80
export NO_PROXY=localhost,.yourcompany.com
12. How to fix error "Please specify script.work.dir to use an alternate location” while running Admin Container?
Make sure you have granted the right permission to 'oracle' user as described in section Mounting a Host Directory as a Data Volume.
Run the below command after substituting your id:
$ sudo /sbin/usermod -a -G docker <userid>
To confirm that userid is part of docker group run below command and make sure it lists group docker:
$ id -Gn <userid>
- Run docker ps -a command to confirm user is able to connect to Docker engine.
Connect to the WCSitesAdminContainer container for performing any operations on WebLogic Server:
$ docker exec -it WCSitesAdminContainer /bin/bash
Connect to the WCSitesManagedContainer container for performing any operations on WebCenter Sites server:
$ docker exec -it WCSitesManagedContainer /bin/bash
Then go to /u01/oracle/sites-container-scripts/
to start & stop respective server from respective container.
To see all the containers, including the exited ones:
$ docker ps –a
To remove containers:
$ docker rm –f <container_id>
To see all the images on host:
$ docker images
To remove images:
$ docker rmi <image_id>
To inspect the container:
$ docker inspect <container name>
To inspect the network:
$ docker inspect <network name>
To stop/start containers:
$ docker stop <container name>
$ docker start <container name>
Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.