VOOZH about

URL: https://thenewstack.io/acorn-from-the-eyes-of-a-docker-compose-user/

⇱ Acorn from the Eyes of a Docker Compose User - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2022-09-27 03:00:34
Acorn from the Eyes of a Docker Compose User
tutorial,
Containers / Kubernetes

Acorn from the Eyes of a Docker Compose User

Acorn simplifies the definition of multicontainer workloads while translating it to respective Kubernetes objects.
Sep 27th, 2022 3:00am by Janakiram MSV
👁 Featued image for: Acorn from the Eyes of a Docker Compose User
Image by Ylanite Koppens from Pixabay. 

In the last article of our series on the Acorn Platform as a Service for Kubernetes, I introduced the architecture and the design of the Acorn deployment framework. This tutorial will compare Acorn with Docker Compose and Kubernetes object definitions.

Before going further, make sure you followed the steps to install Acorn on Minikube explained in the previous tutorial.

Step 1: Exploring Azure Vote Microservices Application

Let’s choose a simple containerized application popular among Docker developers — the Azure Vote application.

The application consists of two layers — a Python Flask frontend and a Redis backend. Each layer of this microservices application is deployed as a container.

To explore the deployment artifact, clone the GitHub repository and open the file azure-vote-all-in-one-redis.yaml

git clone https://github.com/Azure-Samples/azure-voting-app-redis.git
cd azure-voting-app-redis

The directory consists of all the assets, including the Docker Compose file and the source code.


azure-voting-app-redis
│ azure-vote-all-in-one-redis.yaml
│ docker-compose.yaml
│ LICENSE
│ README.md

├───azure-vote
│ │ app_init.supervisord.conf
│ │ Dockerfile
│ │ Dockerfile-for-app-service
│ │ sshd_config
│ │
│ └───azure-vote
│ │ config_file.cfg
│ │ main.py
│ │
│ ├───static
│ │ default.css
│ │
│ └───templates
│ index.html

└───jenkins-tutorial
config-jenkins.sh
deploy-jenkins-vm.sh

Launch the app with Docker Compose and access the web application.

docker-compose up 

👁 Image

Now that we have a working Docker Compose application let us map the concepts to Acorn.

Step 2: Porting Azure Vote Application to Acorn

Technically speaking, we don’t need to port the application. Since the building blocks for Docker Compose, Acorn, and Kubernetes are container images, we will focus on mapping the definition to Acorn.

Open the Docker Compose file and take a look at the service definition.

👁 Image

Line number 3 to 9 define the Redis service by pulling the image, setting the environment variable to enable a blank password, and exposing the port. The remaining lines build the container image from the Dockerfile residing in the azure-vote directory, connecting the web application to the Redis backend and exposing it on port 8080.

Let’s now create the Acorn definition for the same application. Create a directory called Acorn, which contains the Acornfile.

mkdir Acorn && cd Acorn
containers: {
	"azure-vote-back": {
		image: "mcr.microsoft.com/oss/bitnami/redis:6.0.8"
		ports: {
			expose: "azure-vote-back:6379/tcp"
		}
		env: {
			"ALLOW_EMPTY_PASSWORD": "yes"	
		}
	}
	"azure-vote-front": {
		build: "../azure-vote"		
		ports: {
			publish: "80/http"
		}
		env: {
			"REDIS": "azure-vote-back"	
		}

	} 	
}

Run the application with the below command:

acorn run . 

👁 Image

Get the URL of the application by running acorn apps command.

👁 Image

Accessing the minikube IP after modifying the host header shows the Azure Vote application in the browser.

👁 Image

It is obvious that the Acornfile is similar to the Docker Compose file.

👁 Image

The definitions and the structure are similar except for the deployment target. Docker Compose runs in the context of Docker Engine, while Acorn targets a Kubernetes cluster.

Feel free to compare and contrast the Kubernetes YAML file with Acornfile. Acorn simplifies the definition of multicontainer workloads while translating it to respective Kubernetes objects.

You can see how Acorn translates the definition into Kubernetes objects when you explore the namespace created for the Acorn application.

👁 Image

Step 3: Linking Resources with Acorn

PaaS implementations such as Cloud Foundry support binding stateful resources such as databases and cache with one or more stateless services. This approach makes it possible to reuse services without recreating them or dealing with complex synchronization across resources.

Acorn brings binding to Kubernetes applications through a simplified approach. It imitates Cloud Foundry in binding existing services. In the Acornfile for Azure Vote application, we have a Redis service that we can bind to a service deployed in another application.

👁 Image

To explore this concept, create a new directory and an Acornfile with the below contents:

containers: {
	"redis-cli": {
		image: "redis:6.2.7"
	}
}

This file creates an Acorn application with a single microservice based on the Redis image. The idea is to leverage the Redis client CLI in this application to access the Redis server running in the Azure Vote application.

Launch the application with the below command:

acorn run --name redis-client --link silent-sun:azure-vote-back .

Notice the switch --link that links the current application (redis-client) with azure-vote-back service belonging to the silent-sun Acorn app.

Access the container with the acorn exec command.

👁 Image

Let’s connect to the Redis host to access the key/value data stored by the Azure Vote application.

👁 Image

We are now able to reuse one Redis backend for multiple clients. It’s interesting to see that the Redis client can connect to the server with the hostname mentioned in the Azure Vote Acornfile.

Behind the scenes, Acorn has created a service with the redis-client app namespace. What’s unique about this service is that it is of the type ExternalName. According to Kubernetes documentation, an ExternalName Service is a special case of Service that does not have selectors and uses DNS names instead. In this case, the DNS name azure-vote-back simply points to the service residing in the Azure Vote application namespace, silent-sun.

👁 Image

Using ExternalName service to bind services across applications is a clever way of leveraging Kubernetes primitives to imitate PaaS capabilities.

In the next part of this series, we will explore the workflow involved in iterating over the code in development environments and moving Acorn applications to a production environment. Stay tuned.

TRENDING STORIES
Janakiram MSV (Jani) is a practicing architect, research analyst, and advisor to Silicon Valley startups. He focuses on the convergence of modern infrastructure powered by cloud-native technology and machine intelligence driven by generative AI. Before becoming an entrepreneur, he spent...
Read more from Janakiram MSV
SHARE THIS STORY
TRENDING STORIES
Docker and Redis are sponsors of The New Stack.
TNS owner Insight Partners is an investor in: Docker.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.