Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

That app you love, part 2: Immutable but flexible - What settings matter?

<p>&nbsp;</p> <quillbot-extension-portal></quillbot-extension-portal>

September 29, 2016
N. Harrison Ripps
Related topics:
ContainersDeveloper toolsKubernetesMicroservices
Related products:
Red Hat OpenShift Container Platform

    Welcome to the second installment of That App You Love, a blog series in which I show you how to you can make almost any app into a first-class cloud citizen. If you want to start from the beginning, jump back and check out Part 1: Making a connection.

    In our last post, we met my ZNC container, good ol’ znc-cluster-app - but don’t fret about ZNC because we’re really talking about That App You Love - whatever it happens to be. You may recall that we got ZNC up and running using two commands - docker pull and docker run. And in a world where your local system happens to be a cloud computing environment, and containers never crash, you are good to go.

    But we don’t live in that world, and neither does That App You Love. So we’ve got some work to do. For starters, we need to understand what is safe to “bake into” our image, versus what we should be able to adjust when the container is actually running.

    In my case, I’m looking at ZNC, and I’ve determined that even though there are some other settings I could use, the minimum necessary information I need to configure ZNC is as follows:

    • A port number
    • SSL - yes / no?
    • IPv6 - yes / no?
    • A username
    • A password
    • Set up an IRC network - yes / no?

    How did I determine that? ZNC happens to have a nice installer that you can invoke with znc --makeconf. I ran it, accepted every possible default, and noted the values I had to manually supply.

    Technically Optional, Actually Non-Negotiable

    Looking over those six required settings, I can see straight away that there are some that I don’t need to make optional in a running container:

    • Port number - the port number that a container uses internally is almost always remapped to a different port on the host, so there’s not much point in making this setting configurable here.
    • SSL - I can’t think of any reason why I wouldn’t want to run my app securely. I’m sticking this setting in the “on” position.
    • IPv6 - I want this container to work everywhere, and IPv6 support is not available on all cloud platforms. So for now, I’ll pin this to “off”.
    • Set up an IRC network? - This is a convenience function that enables me to set up networks before I actually run ZNC. Since I can set these up later in the app itself, I’m going to set this one to “no”.

    In all four of these cases, I’m making decisions based on two things: how I want to use the app, and what my target platforms can support. So - what’s left?

    Unique Snowflake Options

    This series is called That App You Love, after all, not That App I Love. And in order to make ZNC as universally lovable as possible, we can look back over the variables and see what can and should be configurable: username and password.

    But how do we expose those variables to user in an “immutable” container?

    1. If your ZNC container is still running from Part 1, stop it by running:
      sudo docker stop znc
    2. Now fire it up again with this command, but edit this line with whatever values you like for USERNAME and PASSWORD (and don’t forget to change 9999 to something else if you need to):
      sudo docker run -p 9999:6697 -d -e ZNC_USER=USERNAME -e ZNC_PASS=PASSWORD --name=znc nhripps/znc-cluster-app

      Note: it’s generally bad form to pass a password in clear text to a program. Don’t panic! We’ll do this in a much more secure way by the time this series is done.

    3. Click this link (with port number change if necessary) to see the ZNC web console again:
      https://localhost:9999/
    4. Log in. This time admin/admin won’t work unless you really drew a blank on creative values for USERNAME and PASSWORD and went with what I did.

    But wait - how did our immutable container suddenly configure itself differently?

    Environment Variables: The Ace Up My Sleeve

    If you’ve got previous experience with docker containers, you are probably really unimpressed right now. “Dude,” you say, “all you did was exposed those two values as environment variables. That’s like, containers 101.” And you are correct! Environment variables are a major asset in our quest to cloud-enable That App You Love.

    But the big question is: How did I actually link those environment variables to the app? And an even bigger question that we’ll answer later on - how did I link them in a way that can persist across multiple generations of containers?

    Armed with the knowledge of which variables we want to lock in and which variables we want to expose for customization, we’ll head down the rabbit hole of configuring our container in the next part of this series. See you next time for Part 3: Every Setting In Its Place!

    This series will run every Tuesday and Thursday until we've accomplished our goals, so stay tuned in, subscribe, and thanks for reading!

    Title Date
    That app you love, part 1: Making a connection 2016/09/27
    That app you love, part 2: Immutable but flexible – What settings matter? 2016/09/29
    That app you love, part 3: Every setting in its place 2016/10/04
    That app you love, part 4: Designing a config-and-run container 2016/10/06
    That app you love, part 5: Upping our (cloud) game 2016/10/11
    That app you love, part 6: Container, meet cloud 2016/10/13
    That app you love, part 7: Wired for sound 2016/10/18
    That app you love, part 8: A blueprint for “that app you love” 2016/10/20
    That app you love, part 9: Storage and statefulness 2016/10/25
    That app you love, part 10: Long live “that app you love” 2016/10/27

     

    About the Author

    Hi there! My name is N. Harrison Ripps, and I am an engineer and people manager on the Containers team at Red Hat. Together with the greater open source community, our team has taken the combination of the docker container format and Google’s Kubernetes orchestration system, and then extended this framework with a number of administrator- and developer-friendly features that we call the OpenShift Container Platform.

    Last updated: March 16, 2023

    Recent Posts

    • MCP servers vs. skills: Choosing the right context for your AI

    • How to route external and local LLMs with Models-as-a-Service

    • Protect data offloaded to GPU-accelerated environments with OpenShift sandboxed containers

    • Case study: Measuring energy efficiency on the x64 platform

    • How to prevent AI inference stack silent failures

    What’s up next?

     

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.