Customize Container Environments

  • Chapter
  • First Online:
Oracle on Docker
  • 588 Accesses

Abstract

Running containers is comparable to calling a sophisticated shell script. Containers and shell scripts both perform a scoped set of tasks. Scripts can be explicit, with hard-coded values, but adding some flexibility makes them more portable and valuable. That might mean deriving specific values from the environment or interpreting parameters passed to the script at runtime. Take an RMAN backup script as an example. Hard-coding the database name prevents its use on other databases. Pass the database name as a variable, and the same script works across an enterprise. Adding additional options for the backup destination, degree of parallelism, and incremental level makes the script much more flexible and valuable over various implementations.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
EUR 32.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or Ebook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
EUR 29.95
Price includes VAT (France)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
EUR 49.99
Price includes VAT (France)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
EUR 63.29
Price includes VAT (France)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free ship** worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Chapter 11 describes this and other scripts, including example modifications.

  2. 2.

    docker inspect works against a wide range of Docker objects, including images, containers, volumes, and networks. The JSON output for each object type is different, but the formatting examples shown here can be adapted to suit your needs!

  3. 3.

    jq formats, or “pretty prints” JSON output in more human-readable form. On Ubuntu systems (the default Linux flavor in Windows WSL), install it with sudo apt-get install jq.

  4. 4.

    Aliases and functions are alternatives to remembering verbose syntax. In Appendix B, I’ve included examples of what I use in my environment to simplify complex commands.

  5. 5.

    Docker only allows simple values—no arrays!

  6. 6.

    The value in the container is set to the host value at the time docker run is executed. It’s written to the container metadata, and changes to the value on the host won’t alter the value in the container once the container is created.

  7. 7.

    Options for setting the database edition, enabling archive logging, SGA, PGA, and automatic memory calculation are available for database 19.3 onward.

  8. 8.

    This parameter changes the Oracle Database Edition in the container by relinking the binaries in the Oracle Home. It reconfigures images with Enterprise Edition homes to use Standard Edition, and vice versa. The feature is used to start a container using preexisting datafiles created using a database edition that’s different from the image.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Scott, S. (2023). Customize Container Environments. In: Oracle on Docker. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-9033-0_6

Download citation

Publish with us

Policies and ethics

Navigation