LogoLogo
edgegap.comDashboard
  • 📘Learning Center
    • Getting Started
    • Unity Games
      • Getting Started - Servers
      • Developer Tools
    • Unreal Engine Games
      • Getting Started - Servers
      • Developer Tools
    • Matchmaking
      • Getting Started
      • Matchmaker In-Depth
      • Ping Beacons
    • Advanced Features
      • Apps and Versions
      • Deployments
      • Managed Clusters
  • API Reference
    • Dedicated Servers
    • Integration
    • Matchmaking
    • Peer to Peer
  • Release Notes
  • 📚Documentation
    • Sample Projects
      • Unity Netcodes
        • Unity NGO
        • Photon Fusion 1
        • Photon Fusion 2
        • Mirror
        • Mirror WebGL
        • Fishnet
        • Fishnet WebGL
        • Photon Bolt
      • Unreal Top-Down Sample
      • NuxtJS
      • Ruby On Rails
      • Unity Lobbies
      • Unity Matchmaker
    • Tools & Integrations
      • Container
        • What is Docker
        • Your First Docker
        • The Good Practices
        • SSH in Your Container
        • External Registries
          • Docker Hub
          • AWS ECR
          • GCP GCR
          • Gitlab registry
      • Deploy from Nakama
      • EOS Lobby Integration
      • Switch From Gamelift
      • Switch From Multiplay
      • Playfab Bridge
    • Deployment
      • Endpoint Storage
        • How to Save Logs
        • Upload File to Deployment
      • Webhooks
    • Application
      • Command and Arguments
      • 1:1 Port Mapping
    • Session
      • How They Work
      • Application Version Configuration
      • Manage Request
      • Selectors Filtering
    • Fleet
      • Fleet Policy
      • Policy Filter
      • Linking Version
      • Fleet's Deployment
    • Container Registry
    • Distributed Relay
      • Matchmaker/Lobby
      • Relay Edgegap API
      • Transport Samples
    • Lobby
      • Lobby Service
      • Functions
    • Glossary
    • SLA Terms
Powered by GitBook
LogoLogo

Connect with Community

  • Discord
  • Linkedin
  • X

Read More

  • Release Notes
  • Blog
  • Enterprise
  • Legal
  • edgegap.com

© 2025 Edgegap

On this page
  • Versioning
  • The Tag latest
  • Example for Tagging
  • Why

Was this helpful?

  1. Documentation
  2. Tools & Integrations
  3. Container

The Good Practices

PreviousYour First DockerNextSSH in Your Container

Last updated 2 months ago

Was this helpful?

We strongly recommend you to go through to help you learn the best way to optimize your container and its security.

Here are some tips to optimize your container to work perfectly with Edgegap.

Versioning

Versioning on your container build is an essential aspect of a container's life since a lot of environments will not pull the image again if the tag is already present on the machine.

The Tag latest

By default, when you run the build command:

For ARM CPU (Mac M1, M2, etc.) users, see the .

docker build -t repo/example .

The output will give to this build the tag latest

The following does the same output:

docker build -t repo/example:latest .

But keep in mind, latest is only a tag like any other and does not always represent your latest build.

Example:

docker build -t repo/example:latest .
# do some modification to your code
docker build -t repo/example:0.1 .

Edgegap will NOT update your tag latest and version 0.1 will be ahead with the new code.

Example for Tagging

We recommend bumping or changing your version on every image build to ensure proper usage and avoid caching the old version in the system. Suppose you are already using a system to do semantic versioning or bumping the version on every compilation. In that case, you can make the process of automatically tagging your Docker build pretty easy.

Example of Bash Script to build your Dockerfile with a matching version you pass the argument.

This example will build with the given version, tag to the repository, and push it (Do not forget to login first if you are using a private Repository).

#!/bin/bash

if [[ $# -ne 1 ]] ; then
    echo 'No Argument Provided, Please specify the version you want to build this Image. --> example: ./docker-build.sh 0.0.1'
    exit 1
fi

docker build -t my-repo/example:$1 .

docker tag my-repo/example:$1 registry.edgegap.com/my-repo/example:$1
docker push registry.edgegap.com/my-repo/example:$1

With this script, you can now use your App build version to call it correctly.

Example: You build your new Game Server Version 2021.01.29.1234

# From your CI/CD Pipeline or manually

./docker-build.sh 2021.01.29.1234

Why

The main reason to bump a tag every build is to prevent caching in the Edge.

To be able to boot the server in a matter of seconds, we pre-pull the image and only multiply the number of instances on demand. We can't guarantee the frequency of Pull Policy since we only pull it if the image is not already present on the Edge.

So basically using latest tag or any persistent tag might cause you trouble to fix or debug since you are going to update the build and deploy it on Edgegap but the Edge won't pull the new version your tag since it is the same.

If you never use , Edgegap hardly suggest you read about it and apply this to your build versioning!

📚
the good Practices of Docker
dedicated page
semantic versioning