Skip to main content

Using Custom Commands and Environment Variables

  • Chapter
  • First Online:
Kubernetes Microservices with Docker
  • 5700 Accesses

Abstract

Kubernetes orchestrates Docker containers, and the instructions to run for a Docker image are specified in the Dockerfile. The ENTRYPOINT instruction specifies the command to run, and the CMD instruction specifies the default arguments for the ENTRYPOINT command. Kubernetes provides two fields, "Command" and "Args", to be specified for a container image in a Pod definition to override the default settings of ENTRYPOINT and CMD. We shall discuss these fields in this chapter. We shall also discuss using environment variables in a Pod definition’s container mapping with the "env" field mapping.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Deepak Vohra

About this chapter

Cite this chapter

Vohra, D. (2016). Using Custom Commands and Environment Variables. In: Kubernetes Microservices with Docker. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-1907-2_3

Download citation

Publish with us

Policies and ethics