Inspecting the Stack File: Secrets, Networks, and Volumes

Let's examine the secrets, networks, and volumes section of the stack file.

Stack files

Stack files are identical to Compose files with a few differences at run-time. For example, Docker Compose lets you build images at run-time, but Docker Stacks don’t.

Let’s look at the networking elements defined in our stack file.

Networks and networking

One of the first things Docker does when you deploy an app from a stack file is create the networks listed under the networks key. If they already exist, Docker doesn’t need to do anything. But if they don’t exist, it creates them.

This app defines a single encrypted overlay network called counter-net.

Get hands-on with 1400+ tech skills courses.