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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Chapter 11 describes this and other scripts, including example modifications.
- 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.
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.
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.
Docker only allows simple values—no arrays!
- 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.
Options for setting the database edition, enabling archive logging, SGA, PGA, and automatic memory calculation are available for database 19.3 onward.
- 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
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature
About this chapter
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
DOI: https://doi.org/10.1007/978-1-4842-9033-0_6
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-9032-3
Online ISBN: 978-1-4842-9033-0
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books