项目作者: bravetools

项目描述 :
A tool to build, deploy, and release any environment using System Containers.
高级语言: Go
项目地址: git://github.com/bravetools/bravetools.git
创建时间: 2020-08-28T10:24:09Z
项目社区:https://github.com/bravetools/bravetools

开源协议:Apache License 2.0

下载


Gitter Go Report Card

Bravetools

Bravetools provides a simple and consistent interface to declare, build, and deploy system containers.

Features

How it works

Configuring image environments

The steps to build and deploy an image are configured using a Bravefile.
View sample Bravefiles on GitHub to explore common use cases.

template

Build images

Build new images or layer existing ones using brave build
Resulting image can be stored locally or remotely

Deploy images

System containers can be deployed to a variety of environments with brave deploy, including local development machines, test environments, and remote production systems.

Image management

Manage images with multiple versions and architectures

Deploy multi-unit systems

Systems with multiple units can be declared in a brave compose file.
Build and deploy the system defined in a compose file with the brave compose command.

template

Installation

Prerequisites:

  • Mac/Windows: Multipass
  • Linux:
    • LXD
    • Ensure your user belongs to the lxd group: sudo usermod --append --groups lxd $USER
    • You may also need zfsutils: sudo apt install zfsutils-linux
  1. Download the latest stable release for your host platform and add it to your $PATH.

  2. Run brave init to get started.

Installing from source

Linux/MacOS

  1. git clone https://github.com/bravetools/bravetools
  2. cd bravetools
  3. make [ubuntu]/[darwin]

Windows

  1. git clone https://github.com/bravetools/bravetools
  2. cd bravetools
  3. go build -ldflags="-s -w" -o brave.exe -trimpath main.go

Getting Started

Run brave init to start if you haven’t yet.

  1. brave init
  2. ...

Create an example Bravefile

  1. brave template

This creates a file named “Bravefile” in the current working directory. The contents should look like this:

  1. image: example-image/v1.0
  2. base:
  3. image: alpine/3.16
  4. packages:
  5. manager: apk
  6. system:
  7. - curl
  8. run:
  9. - command: echo
  10. args:
  11. - hello world
  12. copy:
  13. - source: ./Bravefile
  14. target: /root/
  15. service:
  16. name: example-container
  17. ports:
  18. - 8888:8888
  19. resources:
  20. ram: 2GB
  21. cpu: 2
  22. disk: 10GB

Create an image using the Bravefile

  1. brave build
  2. ...

Check images

  1. brave images
  2. IMAGE VERSION ARCH CREATED SIZE HASH
  3. example-image v1.0 x86_64 just now 4MB ef28b49bf36f0b4b9cbad89ff67ef0ee

Deploy image as container

  1. brave deploy

Check running units

  1. brave units
  2. NAME STATUS IPV4 MOUNTS PORTS
  3. example-container Running 10.148.59.45 8888:8888

Add a remote

  1. brave remote add example-remote https://20.0.0.20:8443 --password [PASSWORD]
  2. Certificate fingerprint: ...

Deploy to remote

  1. brave deploy --name example-remote:example-container
  1. brave units
  2. NAME STATUS IPV4 MOUNTS PORTS
  3. example-remote:example-container Running 20.0.0.7 8888:8888
  4. example-container Running 10.148.59.45 8888:8888

Command Reference

  1. A complete System Container management platform
  2. Usage:
  3. brave [command]
  4. Available Commands:
  5. base Pull a base image from LXD Image Server or public Github Bravefile
  6. build Build an image from a Bravefile
  7. compose Compose a system from a set of images
  8. configure Configure local host parameters
  9. deploy Deploy Unit from image
  10. help Help about any command
  11. images List images
  12. import Import LXD image tarballs into local Bravetools image repository
  13. info Display workspace information
  14. init Create a new Bravetools host
  15. mount Mount a directory to a Unit
  16. publish Publish deployed Units as images
  17. remote Manage remotes
  18. remove Remove Units or Images
  19. start Start Units
  20. stop Stop Units
  21. template Generate a template Bravefile
  22. umount Unmount <disk> from UNIT
  23. units List Units
  24. version Show current bravetools version
  25. Flags:
  26. -h, --help help for brave
  27. Use "brave [command] --help" for more information about a command.