Step 4: Build WebLogic Domain Image

Make sure you created the WebLogic Install image as described in Step 3 before proceeding.

Like I mentioned in one of the previous steps, Oracle has been awesome enough to provide us with some sample dockerfiles for constructing various docker images. In the samples directory of the OracleWebLogic project directory, you will find dockerfiles for building various domain images. Oracle has provided these samples for purposes of accelerating development of docker images for WebLogic. These are public use – so feel free to use these samples as a starting point for your projects.

We are going to create an image for a fairly simple domain configuration. In this domain we’ll have our usual admin server and one managed server.

The image we’re going to build is 1221-domain.

Change directory to docker-images/OracleWebLogic/samples/1221-domain and run the script with the parameters below.



This build script will create a domain docker image with the following default parameters:

  • Admin Port: 8001
  • Admin Password: weblogic123
  • Domain name: base_domain
  • Production mode: dev

If you want to customize any of these parameters, take a look at the Dockerfile for 1221-domain. This file can be modified to over some default values for the domain.


Again, you can run docker images to see the image was indeed created.



For our last and final step, we can now go ahead and create a running domain. Step 5: Running WebLogic.

Step 4: Build WebLogic Domain Image
Tagged on:     
  • Carlos Risueño


    I’m trying to build this image but I encounter some problems. Have you made any changes in the original files to make it work?
    Firstly, I have to put the ADMIN_PASSWORD parameter inside the because it doesn’t get the proper value passed as an arg.
    Then, the Dockerfile execution never finish, it stays in a standby state after exiting the WLST (the last message showed is “Exiting WebLogic Scripting Tool.”)

    Thank you in advance

    • Chris

      Hi Carlson, I’ll take a look at this issue over the next day or so. Oracle has updated their dockerfile and sample build script since I wrote this post so it’s possible it maybe out of date. I’ll get back in touch tomorrow after the holiday.


      • Carlos Risueño

        Hi Chris,

        Thank you very much, I’ll wait for your reply 🙂

        • Chris

          Carlos, Oracle changed the parameters of their sample build script. Try this to build your domain image:

          $ docker build -t 1221-domain –build-arg ADMIN_PASSWORD=welcome1 –build-arg ADMIN_NAME=WL_AdminServer .

          Be sure you’ve created the Weblogic 12.2.1 install image first, then run the above command to extend that image. I’ll update the article to reflect this change. Let me know if you have any other issues. Thanks

          • Carlos Risueño

            Hi Chris,
            It’s weird, I tried the same but it doesn’t work. The is not capable to get the ADMIN_PASSWORD I have passed to the docker build command. Anyway, that’s not my main problem as I said before, because I’ve changed the script putting the ADMIN_PASSWORD value in it.

            My problem is that the build command never finish, it remains exiting of the WLS tool (see the attached image below)

            Thank you very much for your help!

          • Chris

            I wonder if the ADMIN_PASSWORD passing is a sign of a larger issue. How/where did you override this value? Double check the Dockerfile to see where this is used throughout…specifically its this command in the Dockerfile that you’re seeing issues with. If you’re overridding the password somewhere make sure it trickles down to the other commands, specifically the file. If the password isn’t set in this file, then the domain will not start and that might be why you’re seeing the build hang.

            # Configuration of WLS Domain
            RUN /u01/oracle/wlst /u01/oracle/ &&
            mkdir -p /u01/oracle/user_projects/domains/$DOMAIN_NAME/servers/AdminServer/security &&
            echo “username=weblogic” > /u01/oracle/user_projects/domains/$DOMAIN_NAME/servers/AdminServer/security/ &&
            echo “password=$ADMIN_PASSWORD” >> /u01/oracle/user_projects/domains/$DOMAIN_NAME/servers/AdminServer/security/ &&
            echo “. /u01/oracle/user_projects/domains/$DOMAIN_NAME/bin/” >> /u01/oracle/.bashrc

Show Buttons
Hide Buttons