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

Moving an RHSCL app to Docker on Atomic

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

May 7, 2014
Langdon White
Related topics:
ContainersLinux
Related products:
Red Hat Enterprise Linux

    As many of you have probably heard, Red Hat announced a new "Docker server" at Summit. The new server is called "Atomic" and details can be found at the project home page. As you all know, I tend to be interested in using Software Collections to ensure the portability of applications. So, putting my foot^W money where my mouth is, I decided to download Atomic, run it as a VM, create a Docker image with a Software Collection, and copy a previous app there, unchanged. The pros and cons of running an application as a Docker container are debated heavily elsewhere, so we won't discuss the "why" (unless you tell us we should in the comments :) ), just the "how."

    For a little context, I wrote an article about an application that let's you interact with Twitter via IRC using node.js and RHSCL. The application is fairly simple, but could not be run with just base RHEL, so it was a great example of a RHSCL application.

    First, I, Valhalla forbid, read the directions at the Project Atomic "Getting Started" page. Per the docs, I downloaded the xz file (which, weirdly, does not include "atomic" anywhere in the filename), extracted the qcow2 file, made a VM, and added some extra storage with another raw file. In general, I didn't have any trouble with following the Quick Start Guide except for a couple confusing steps (which I think were a mismatch between the version of virt-manager used for the doc and the one in RHEL 7). Basically, you have to pick the VM name at the beginning and F20 is not a choice. I just chose a Fedora that was available.

    However, when I went to go actually "use" the VM, I found myself to be mildly confused. Is Atomic meant to be used like Vagrant, where I run the Docker commands outside the VM, or should I be running the commands inside the running VM? Upon consultation with Joe Brockmeier, one of the community folks for Project Atomic, I found out that you run the commands in the VM. And, per Joe, "Langdon, I think you might be overthinking it." To which I say, "yeah, I have a talent."

    Ok, now that Atomic is installed, I need to go make a container. After a few fits and starts, mostly related to pathing issues while using the "RUN" command, I got a decent Dockerfile working. You "run" this file by using the "docker build" command. Later, you "make the app go" with the "docker run" command. I have excerpted it below:

    FROM centos
    # Install scls and nodejs
    RUN yum update -y
    RUN yum install -y centos-release-SCL
    RUN yum update -y
    RUN yum install -y scl-utils nodejs010
    # Clean up
    RUN yum clean all
    #FROM 1angdon/node-scl-centos
    # ^^^ this is a good place to break to make multiple app containers
    #add app
    ADD . /src
    RUN cd /src; scl enable nodejs010 &quot;npm install&quot;
    CMD cd /src; scl enable nodejs010 &quot;node server.js&quot;

    To start, you may notice I used CentOS as the base image. (Currently, RHEL is not available as a base image.) I then proceed to make sure everything is current. Then I move on to adding a repository for the Software Collections available in CentOS:

    RUN yum install -y centos-release-SCL

    I then do another update and then install the nodejs (v0.10) scl. I also install scl-utils, which, honestly, I think is a dependency, but better safe than sorry. I then clean up yum to remove anything it downloaded to try to save on space, as I won't be downloading anything else via yum.

    The next line is just a comment to show that if I was doing this in a "real" environment, I would probably break the Dockerfile here and use the part above the break as a base nodejs image. I then proceed to add my source files, basically (more on this later) the exact same ones from the earlier article. I then use npm to add my node dependencies. Finally, I have a "CMD" operation which will actually start the server when using the "docker run" command.

    If you notice, I used a "cd /src;" at the beginning of each of the scl-related operations. For some reason, I was not having good luck with a "RUN cd /src" actually persisting the directory change for the next RUN command. This may be by design, or something I am missing.

    Finally, as I said above, I "basically" used the same files from the repo, however, I found some bugs in the original source :). First, I got the code working again on RHSCL, then I proceeded with the above.

    In conclusion, making Docker on Atomic version of a simple node.js app is really pretty easy. Let me know how you make out.

    Last updated: November 2, 2023

    Recent Posts

    • Running AI inference on Rebellions ATOM NPU with Red Hat AI

    • How we built integration testing for fast-moving AI backend

    • Testing infrastructure red teaming with abliterated models

    • Build an enterprise RAG system with OGX

    • Solutions for SELinux MCS challenges with GitLab runners

    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.