Skip to content

Improvements to makefile and development container#3539

Merged
thaJeztah merged 3 commits into
docker:masterfrom
thaJeztah:easier_make
Apr 30, 2022
Merged

Improvements to makefile and development container#3539
thaJeztah merged 3 commits into
docker:masterfrom
thaJeztah:easier_make

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

This makes some small improvements to the makefile and development container:

Makefile: add missing help messages for some targets

Some targets didn't have a help message. After this:

Screenshot 2022-04-06 at 19 13 15

Dockerfile.dev: set prompt, add nano and jq, and set MOTD

This makes some minor improvments to the dev container:

  • add nano as an alternative to vi to help beginning contributors, or people
    that don't remember how to quit vi ;-)
  • add jq as it's often handy to have available to debug JSON output.
  • set a custom prompt to make it clearer that the user is in a container
  • add a short MOTD that shows that the user is in a container, and a pointer
    to 'make help' (we can add more help/instructions to this MOTD in future).

Before this patch:

make -f docker.Makefile dev
...
bash-5.1#

With this patch:

make -f docker.Makefile dev
...

You are now in a development container. Run 'make help' to learn about
available make targets.

root@docker-cli-dev$

Screenshot 2022-04-06 at 18 49 22

Makefile: don't warn "outside container" for some targets

This change allows some make targets to be ran outside the dev-container for
easier discovery and use:

  • make clean can be used on the host (as artifacts created from within the
    development container are usually stored on the host).

  • make help was already allowed

  • make dev and make shell are added to the regular Makefile, to make it
    easier to create and start the development container.

  • When attempting to run make dev from within the development container, a
    message is printed, and the target is cancelled:

    root@docker-cli-dev$ make dev
    you are already in the dev container

The warning has also been tweaked slightly:

Screenshot 2022-04-06 at 19 15 42

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This makes some minor improvments to the dev container:

- add `nano` as an alternative to `vi` to help beginning contributors, or people
  that don't remember how to quit `vi` ;-)
- add `jq` as it's often handy to have available to debug JSON output.
- set a custom prompt to make it clearer that the user is in a container
- add a short MOTD that shows that the user is in a container, and a pointer
  to 'make help' (we can add more help/instructions to this MOTD in future).

Before this patch:

    make -f docker.Makefile dev
    ...
    bash-5.1#

With this patch:

    make -f docker.Makefile dev
    ...

    You are now in a development container. Run 'make help' to learn about
    available make targets.

    root@docker-cli-dev$

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This change allows some make targets to be ran outside the dev-container for
easier discovery and use:

- `make clean` can be used on the host (as artifacts created from within the
  development container are usually stored on the host).
- `make help` was already allowed
- `make dev` and `make shell` are added to the regular Makefile, to make it
  easier to create and start the development container.
- When attempting to run `make dev` from within the development container, a
  message is printed, and the target is cancelled:

      root@docker-cli-dev$ make dev
      you are already in the dev container

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah

Copy link
Copy Markdown
Member Author

@crazy-max @silvin-lubecki PTAL

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Merging #3539 (94e08f2) into master (73b05aa) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #3539   +/-   ##
=======================================
  Coverage   59.00%   59.00%           
=======================================
  Files         284      284           
  Lines       23839    23839           
=======================================
  Hits        14066    14066           
  Misses       8914     8914           
  Partials      859      859           

@thaJeztah thaJeztah removed this from the 22.04.0 milestone Apr 14, 2022

@rumpl rumpl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@thaJeztah thaJeztah added this to the 22.04.0 milestone Apr 30, 2022
@thaJeztah

Copy link
Copy Markdown
Member Author

Thx! Let me bring this one in

@thaJeztah thaJeztah merged commit 9060ad6 into docker:master Apr 30, 2022
@thaJeztah thaJeztah deleted the easier_make branch April 30, 2022 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants