Skip to content

Wrapper for script for docker-compose adding some very useful convenience commands.

License

Notifications You must be signed in to change notification settings

vchain-us/docker-compose-wrapper

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

docker-compose-wrapper

Overview

Wrapper for script for docker-compose adding some very useful convenience commands:

Convenience commands (parameters in brackets are optional):
cleanup            Removes all docker containers and images
edit               Edit the current compose file in vi
exec <name> <cmd>  Executes a command in a container
gc     [<name>]    Removes unused docker containers and images
inspect <name>     Show all container information in JSON format
shell   <name>     Opens a bash terminal in a container
show               Shows the current compose file
stats  [<name>]    Print system usage statistics for containers
status [<name>]    See 'ps' command
renew  [<name>]    Renews containers by stopping, removing and creating them
update [<name>]    Updates containers by pulling, stopping, removing and creating them
auth   [<name>]    Authenticate container images by pulling, authenticate using CodeNotary
notarize [<name>]  Notarize container images by pulling, notarize using CodeNotary

Prerequisites

Auth Status level

Code Status Color Description Error message Explanation
0 TRUSTED green The asset was notarized. none The blockchain indicates that the asset is authentic and the signer trusts it.
2 UNKNOWN yellow The asset is not notarized. hash is not notarized [by <key/list of keys/org>] No notarization is found on the blockchain for the asset.
1 UNTRUSTED red The asset is untrusted. hash is untrusted [by <key/list of keys/org>] The blockchain indicates that the signer DOES NOT trust the asset.
3 UNSUPPORTED red The asset is unsupported. hash is unsupported [by <key/list of keys/org>] The blockchain indicates that the signer DOES NOT trust the asset because it is not supported anymore (e.g. deprecated).

Notarize environment variables


Name Description Example
VCN_USER, VCN_PASSWORD Credentials for non-interactive user login [email protected] VCN_PASSWORD=<your_password> vcn login
VCN_NOTARIZATION_PASSWORD Notarization password for non-interactive notarization VCN_NOTARIZATION_PASSWORD=<your_notarization_passphrase> vcn notarize <asset>

Installation

  • Download docker-compose-wrapper script to /usr/local/bin folder:

    sudo wget https://raw.githubusercontent.com/chrisipa/docker-compose-wrapper/master/docker-compose-wrapper -O /usr/local/bin/docker-compose-wrapper
    
  • Make docker-compose-wrapper script executable:

    sudo chmod +x /usr/local/bin/docker-compose-wrapper
    
  • Create sample init script /etc/init.d/my-app-stack for your application stack:

    #!/bin/bash
    ### BEGIN INIT INFO
    # Provides:          my-app-stack
    # Required-Start:    docker
    # Required-Stop:
    # Default-Start:     3 5
    # Default-Stop:      0 1 2 6
    # Description:       My App Stack Init Script
    ### END INIT INFO
    
    # set environment variables
    export TZ="Europe/Berlin"
    
    # set compose file location
    composeFile="/opt/my-app-stack/docker-compose.yml"
    
    # include docker-compose-wrapper script
    source /usr/local/bin/docker-compose-wrapper
    
  • Make init script executable:

    sudo chmod +x /etc/init.d/my-app-stack
    
  • Register init script for autostart:

    sudo chkconfig my-app-stack on
    
  • Now you can use your init script to control docker-compose in a convenient way:

    sudo service my-app-stack
    

About

Wrapper for script for docker-compose adding some very useful convenience commands.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%