Giter Site home page Giter Site logo

make-compose's Introduction

Dealing with a bunch of services in a docker-compose.yaml can be difficult.

This makefile will parse a docker-compose and create rules for each service listed: make _up/down/logs/journal/status/restart/build/pull

Command line completion makes it easy to type a little of your service-name and

You can also get all results by dropping the _: make up/down/logs/status/restart

There is another target for all services, "make top", to which just does "docker-compose top". Even more concise is "make ps", which again just does "docker-compose ps".

You can test your yaml formatting with "make test".

Networking

If you don't want this, just set NFT_TOOL=true in the makefile.

This make structure also assumes you need to handle adding/removing nftables rules for your docker interface. This is the case when your docker is configured (in docker.json) with: "iptables":false, "userland-proxy": false

You must know a lot about networking! Update the makefile variables with your nftable table name, and pre-routing chain. You will want to clone the nft_tool repo: https://github.com/josefwells/nft_tool

Logs

To see logs from a container run: make _logs

Due to the way we run/remove old containers, these logs are not reachable once a container is brought down. Not super helpful when you are trying to figure out what is going on with a container that fails, etc.

If you want some logs to persist, you can log to journald by editing /etc/docker/daemon.json "log-driver": "journald"

Then I've added: make _journal

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.