-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add podman support
- Loading branch information
Showing
45 changed files
with
384 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
pull_request_rules: | ||
- name: Automatic merge on approval | ||
conditions: | ||
- "#approved-reviews-by>=1" | ||
actions: | ||
merge: | ||
method: squash | ||
- name: comment with default | ||
conditions: | ||
- label=comment | ||
actions: | ||
comment: | ||
message: I 💙 Mergify | ||
bot_account: Autobot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
runtime: docker | ||
docker: | ||
registry: registry.cynarski.pl | ||
namespace: LeDo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
![logo](./docs/logo.svg) | ||
|
||
# Table of contents | ||
|
||
|
@@ -10,17 +11,21 @@ | |
- [Docker compose basics](#docker-compose) | ||
- [Thanks](#thanks) | ||
|
||
|
||
# About | ||
|
||
Ledo (LeadDocker) is a simple tool to facilitate the daily work with docker-compose in a project (it doesn't work in swarm for now). It allows you to create run modes and fully automate them. | ||
|
||
Ledo supports `docker` and `podman`, in the case of `podman` you need to configure it properly on your own system (links to tutorials can be found below) | ||
|
||
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/paramah/ledo) | ||
|
||
[![Chat on Matrix](https://matrix.to/img/matrix-badge.svg)](https://matrix.to/#/#ledo:matrix.cynarski.dev) | ||
|
||
# Install | ||
|
||
## Using binnary | ||
|
||
Go to [Release page](https://github.com/paramah/ledo/releases), download, unpack and move to some `PATH` directory. | ||
Go to [Release page](https://github.com/paramah/ledo/releases), download, unpack and move to some `PATH` directory. | ||
|
||
You can also use the installation script: | ||
|
||
|
@@ -36,11 +41,27 @@ go install github.com/paramah/[email protected] | |
|
||
# Usage | ||
|
||
## Project code structure | ||
|
||
``` | ||
├── app (**application**) | ||
├── docker (**docker/podman stack**) | ||
│ ├── docker-compose.dev.yml | ||
│ ├── docker-compose.launch.yml | ||
│ ├── docker-compose.test.yml | ||
│ ├── docker-compose.yml | ||
│ ├── docker-entrypoint.sh | ||
│ ├── etc (**files to be copied into the container**) | ||
│ └── test-entrypoint.sh | ||
├── Dockerfile | ||
``` | ||
|
||
## Init | ||
|
||
Using the `ledo init` command, you can create a `.ledo.yml` configuration file that will contain all the necessary data to use ledo, example configuration file: | ||
|
||
```yaml | ||
runtime: docker | ||
docker: | ||
registry: registry.example.com | ||
namespace: Test | ||
|
@@ -61,6 +82,15 @@ Ledo executes the `docker-compose` command with properly prepared parameters, de | |
|
||
[![asciicast](https://asciinema.org/a/fPVl1wmtZpZXnPl3ZazoenUhD.png)](https://asciinema.org/a/fPVl1wmtZpZXnPl3ZazoenUhD) | ||
|
||
## Podman compose | ||
|
||
For `podman` Ledo executes `podman-compose` command. | ||
|
||
## Podman configuration | ||
|
||
- [Podman tutorial](https://github.com/containers/podman/blob/main/docs/tutorials/podman_tutorial.md) | ||
- [Rootless tutorial](https://github.com/containers/podman/blob/main/docs/tutorials/rootless_tutorial.md) | ||
|
||
# Thanks | ||
|
||
- [Jazzy Innovations](https://jazzy.pro) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/paramah/ledo/app/cmd/container" | ||
"github.com/paramah/ledo/app/modules/compose" | ||
"github.com/paramah/ledo/app/modules/config" | ||
"github.com/paramah/ledo/app/modules/context" | ||
"github.com/urfave/cli/v2" | ||
) | ||
|
||
var CmdContainer = cli.Command{ | ||
Name: "container", | ||
Aliases: []string{"c", "docker", "d"}, | ||
Category: catHelpers, | ||
Usage: "container helper", | ||
Description: `Manage compose tools (docker or podman) in project`, | ||
Subcommands: []*cli.Command{ | ||
&container.CmdDockerPs, | ||
&container.CmdDockerUp, | ||
&container.CmdComposeBuild, | ||
&container.CmdComposeDebug, | ||
&container.CmdComposeDown, | ||
&container.CmdComposeLogs, | ||
&container.CmdComposeRestart, | ||
&container.CmdComposeRun, | ||
&container.CmdComposeExec, | ||
&container.CmdDockerRm, | ||
&container.CmdComposeShell, | ||
&container.CmdComposeStart, | ||
&container.CmdComposeUpOnce, | ||
&container.CmdComposePull, | ||
&container.CmdComposeStop, | ||
&container.CmdDockerLogin, | ||
&container.CmdPrune, | ||
}, | ||
Before: func(cmd *cli.Context) error { | ||
ctx := context.InitCommand(cmd) | ||
if ctx.Config.Runtime == config.Docker { | ||
compose.CheckDockerComposeVersion() | ||
} | ||
|
||
if ctx.Config.Runtime == config.Podman { | ||
compose.CheckPodmanComposeVersion() | ||
} | ||
|
||
return nil | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package container | ||
|
||
import ( | ||
"github.com/paramah/ledo/app/modules/compose" | ||
"github.com/paramah/ledo/app/modules/context" | ||
"github.com/urfave/cli/v2" | ||
) | ||
|
||
var CmdConfiguration = cli.Command{ | ||
Name: "configuration", | ||
Usage: "how to configure container service", | ||
Description: `Display configuration hints for containers`, | ||
Action: RunConfiguration, | ||
} | ||
|
||
func RunConfiguration(cmd *cli.Context) error { | ||
ctx := context.InitCommand(cmd) | ||
compose.ExecComposerBuild(ctx, *cmd) | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package docker | ||
package container | ||
|
||
import ( | ||
"github.com/paramah/ledo/app/modules/compose" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package docker | ||
package container | ||
|
||
import ( | ||
"github.com/paramah/ledo/app/modules/compose" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package docker | ||
package container | ||
|
||
import ( | ||
"github.com/paramah/ledo/app/modules/compose" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package docker | ||
package container | ||
|
||
import ( | ||
"github.com/paramah/ledo/app/modules/compose" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package docker | ||
package container | ||
|
||
import ( | ||
"github.com/paramah/ledo/app/modules/compose" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package docker | ||
package container | ||
|
||
import ( | ||
"github.com/paramah/ledo/app/modules/compose" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package docker | ||
package container | ||
|
||
import ( | ||
"github.com/paramah/ledo/app/modules/compose" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package docker | ||
package container | ||
|
||
import ( | ||
"github.com/paramah/ledo/app/modules/compose" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package docker | ||
package container | ||
|
||
import ( | ||
"github.com/paramah/ledo/app/modules/compose" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package docker | ||
package container | ||
|
||
import ( | ||
"github.com/paramah/ledo/app/modules/compose" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package docker | ||
package container | ||
|
||
import ( | ||
"github.com/paramah/ledo/app/modules/compose" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.