Code Monkey home page Code Monkey logo

dc's People

Contributors

brhahlen avatar dependabot[bot] avatar mrtnbr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

dc's Issues

`list` does not work as expected with `docker compose`

dc list is supposed to list all services described in the docker-compose.yml file.

While using docker-compose, this worked by using the command ps --services -a.
With compose v2, this now uses the config flag, as, rightfully, ps should only list the running containers.

The issue is described here docker/compose#9395

Need to implement some kind of statement that changes the behavior based on the ${DC_COMMAND}.

Also, maybe 2.0.0 will need to remove compatibility with docker-compose.

macvlan setup - customised

Add the ability to make macvlan setup configurable.
Meaning: ability to setup ip addresses etc by yourself

Would like option to disable version check

I was experiencing DNS issues on my host, which made dc slow. Option to disable version check would be nice.

Maybe in command line and/or via environment variable (set in install)

"dc up" for a stack that does not exist needs better error handling

user@hostname:~$ dc up 01-backend
Bringing up stack(s) 01-backend
/home/user/bin/dc: line 103: cd: /home/user/docker/docker-compose/01-backend: No such file or directory
ERROR:
Can't find a suitable configuration file in this directory or any
parent. Are you in the right directory?

    Supported filenames: docker-compose.yml, docker-compose.yaml

/home/user/bin/dc: line 105: cd: OLDPWD not set

sudo check

Create a check for sudo rights to be able to set macvlan and routes

Multiple "File is too old, refreshing"

user@hostname:~/docker/docker-compose$ dc restart watchtower
Restarting the following service(s): watchtower
Stopping the following service(s): watchtower
File is too old, refreshing
File is too old, refreshing
File is too old, refreshing
File is too old, refreshing
File is too old, refreshing
Stopping watchtower ... done
Going to remove watchtower
Removing watchtower ... done
Starting the following service(s): watchtower
Creating watchtower ... done

`dc update` is acting wonky

When running dc update, some wonkiness is observed.
Kind of looks like a loop, or something.

Example (Fedora):

You are on version v1.6.0 of dc
Version v2.0.1 of dc is available and will be downloaded and installed
/tmp/dc_update does not exist. Creating...
Downloading...
/tmp/dc_update/dc-release.zip                100%[===================================>]   8.60K  --.-KB/s    in 0s
Extracting...
Updating...
Found docker compose
Home directory is /home/download
Copying dc binary to/home/download/bin and making it executable
Copying dc-completion binary to /home/download/.bash_completion.d/ and making it executable
Removing DC_CMD variable
Done
You are on version v1.6.0 of dc
Version v2.0.1 of dc is available and will be downloaded and installed
Cleanup previous update files...
Downloading...
/tmp/dc_update/dc-release.zip                100%[====================================>]   8.60K  --.-KB/s    in 0s
Extracting...
Updating...
Found docker compose
Home directory is /home/download
Copying dc binary to/home/download/bin and making it executable
Copying dc-completion binary to /home/download/.bash_completion.d/ and making it executable
Done

Example 2 (Ubuntu):
image

Update functionality

Allow users to run dc update (or from the version check) to download the latest version of dc and install/update it.

Could also be part of the main "install" feature?

pull

Add pull functionality, to pull new images ahead of restart

Verbosity

Add option for more verbose output when running the script

Add `docker compose` functionality

docker compose is the new way of using compose, that replaces docker-compose (or so I think).

dc will need to have this functionality.

Sudo-less user install

Requiring sudo for a user install isn't best practice for security and flexibility reasons.

The current reason that sudo is required (as far as I can tell) is for the installation of the Bash completions. If a flag were introduced that controlled whether or not the completions were installed (either --no-completions or --completions, depending on the default behavior), that would allow a user to choose whether or not to install with sudo.

Obviously, the perfect solution here would be to put the completions in a user directory, but I am unsure if Bash has this ability.

Example usage

Why would I use this instead of docker-compose? What would that look like?

"dc list" gives "--env-file: command not found" error

maarten@balthasar:~$ dc list
Listing Stacks and Services
-----------------------------------
Stack 01-backends contains services:
/home/maarten/bin/dc: line 481: --env-file: command not found
-----------------------------------
Stack 02-system contains services:
/home/maarten/bin/dc: line 481: --env-file: command not found
-----------------------------------
Stack 03-system-frontends contains services:
/home/maarten/bin/dc: line 481: --env-file: command not found
-----------------------------------
Stack 04-home contains services:
/home/maarten/bin/dc: line 481: --env-file: command not found
-----------------------------------
Stack 05-web contains services:
/home/maarten/bin/dc: line 481: --env-file: command not found
-----------------------------------
Stack 06-media contains services:
/home/maarten/bin/dc: line 481: --env-file: command not found
maarten@balthasar:~$ 

"dc help" prints "Invalid command help, showing help" showing command "help Print help"

maarten@balthasar:~$ dc help
Invalid command help, showing help 
Usage: /home/maarten/bin/dc [command] [stacks]

Commands:
 install              Install dc for the user, needs sudo
 up                   Bring up all stacks, a stack, or stacks
 down                 Bring down all stacks, a stack or stack(s)
 restart-stack-hard   Restarts all stacks, a stack or stack(s)
 restart-stack-soft   Restarts all stacks, a stack or stack(s)
 logs-stack           Shows logs for a stack or stacks
 start                Starts one or more services
 stop                 Stops one or more services
 restart              Restarts one or more services
 pull                 Pulls an image of a service
 logs                 Shows logs for a service or services
 network              Create the MacVLAN network, needs sudo
 list                 List stacks and services in the stacks
 help                 Print help
 version              Shows the version and checks the latest version

Allow for options

Currently, the script is quite rigid and there are a lot of things that we could into account.

Ideally, there would be the ability to allow for options, such as:

  • -v for verbosity (see also #15 )
  • --restart-only for restarting a service, without removing it (example only)
  • ...and possible more

Consistency in using `echo` or `printf`

Currently using echo and printf in different spots in the script.
Need to ensure that there is consistency here.

Idea is to use printf for everything that will be shown to the user, and echo for everything that "creates" something

Typo in help

Usage: /home/maarten/bin/dc [options] [stacks/

should be

Usage: /home/maarten/bin/dc [options] [stacks]

restart option for stacks

I cannot restart stacks with dc, only containers. It would be nice to also be able to restart stacks.

Installation "method"

Simplest way of installing the program.
Needs to do:

  • Install dc into ~/bin
  • Make it executable
  • add ~/bin to PATH in ~/.bashrc
  • Ask question for DC_DIR and set to PATH

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.