1. MooseStack
  2. Moose Deploy
  3. Packaging Moose for deployment

Packaging Moose for Deployment

Once you've developed your Moose application locally, you can package it for deployment to your on-prem or cloud infrastructure.

The first step is to navigate (cd) to your moose project in your terminal.

cd my-moose-project

The Moose CLI you've used to build your Moose project also has a handy flag that will automate the packaging and building of your project into docker images.

moose build --docker

After the above command completes you can view your newly created docker files by running the docker images command:

>docker images
REPOSITORY                                              TAG               IMAGE ID       CREATED              SIZE
moose-df-deployment-aarch64-unknown-linux-gnu           latest            c50674c7a68a   About a minute ago   155MB
moose-df-deployment-x86_64-unknown-linux-gnu            latest            e5b449d3dea3   About a minute ago   163MB

Notice that you get two moose-df-deployment containers, one for the aarch64 (ARM64) architecture and another for the x86_64 architecture. This is necessary to allow you to choose the version that matches your cloud or on-prem machine architecture.

You can then use standard docker commands to push your new project images to your container repository of choice.

First tag your local images:

docker tag moose-df-deployment-aarch64-unknown-linux-gnu:latest {your-repo-user-name}/moose-df-deployment-aarch64-unknown-linux-gnu:latest
docker tag moose-df-deployment-x86_64-unknown-linux-gnu:latest {your-repo-user-name}/moose-df-deployment-x86_64-unknown-linux-gnu:latest

Then push your files to your container repository.

docker push {your-repo-user-name}/moose-df-deployment-aarch64-unknown-linux-gnu:latest
docker push {your-repo-user-name}/moose-df-deployment-x86_64-unknown-linux-gnu:latest

You can also use the following handy shell script to automate the steps above.

#!/bin/bash
 
version=$2
 
if [ -z "$1" ]
then
      echo "You must specify the dockerhub repository as an argument. Example: ./push.sh container-repo-name"
      echo "Note: you can also provide a second argument to supply a specific version tag - otherwise this script will use the same version as the latest moose-cli on Github."
      exit 1
fi
 
if [ -z "$2" ]
then
      output=$(npx @514labs/moose-cli -V)
      version=$(echo "$output" | sed -n '2p' | awk '{print $2}')
fi
 
echo "Using version: $version"
arch="moose-df-deployment-aarch64-unknown-linux-gnu"
docker tag $arch:$version $1/$arch:$version
docker push $1/$arch:$version
 
arch="moose-df-deployment-x86_64-unknown-linux-gnu"
docker tag $arch:$version $1/$arch:$version
docker push $1/$arch:$version
  • Overview
  • Quick Start
  • Templates / Examples
Fundamentals
  • Moose Runtime
  • MooseDev MCP
  • Data Modeling
MooseStack in your App
  • App / API frameworks
Modules
  • Moose OLAP
  • Moose Streaming
  • Moose Workflows
  • Moose APIs
Deployment & Lifecycle
  • Moose Migrate
  • Moose Deploy
    • Packaging Moose for deployment
    • Preparing Infrastructure
    • Cloud Configuration
    • Kubernetes Deployment
    • AWS ECS Deployment
    • Offline Deployment
    • Docker Compose Deployment
    • Monitoring (moved)
Reference
  • API Reference
  • Data Types
  • Table Engines
  • CLI
  • Configuration
  • Observability Metrics
  • Help
  • Changelog
Contribution
  • Documentation
  • Framework
FiveonefourFiveonefour
Fiveonefour Docs
MooseStackTemplates
Changelog
Source506