Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added clarifications about customizing docker images #3604

Merged
merged 11 commits into from Jul 6, 2022

Conversation

timblaktu
Copy link
Contributor

Provides some clarification about how docker image customization works. This info had to be gleaned from the source code and external sources like reddit and SO.

I hope this community feedback will be adopted to ease adoption of future molecule users.

Resolves #3603.

@timblaktu timblaktu requested review from a team as code owners June 21, 2022 18:27
@timblaktu timblaktu requested review from greg-hellings, sky-joker, ssbarnea, ganeshrn and cidrblock and removed request for a team June 21, 2022 18:27
@jseguillon
Copy link

Hi @timblaktu thanks for helping on this. As you can see, github actions are complaining about lints and docs targets.

Could you take a look at contribution guide (https://github.com/ansible-community/molecule/blob/main/docs/contributing.rst), especially on #lints and #docs targets and adapt PR ?

@timblaktu
Copy link
Contributor Author

@jseguillon now we're green. Sorry for the delay and commit proliferation, I don't have the tooling set up locally and was just leaning on Github for editing/linting. Let me know if you'd like to see anything else or have any questions.

@jseguillon
Copy link

LGTM but I don't use much Docker with molecule.
Anyone else to comment ?

@ziegenberg
Copy link
Contributor

I'll have a look at it

docs/examples.rst Outdated Show resolved Hide resolved
@zhan9san
Copy link
Contributor

zhan9san commented Jul 6, 2022

@ziegenberg

I'll have a look at it

Do you have concerns?

@ssbarnea ssbarnea changed the title 3603: added clarifications about customizing docker images Added clarifications about customizing docker images Jul 6, 2022
@ssbarnea ssbarnea merged commit f434fb1 into ansible:main Jul 6, 2022
@ziegenberg
Copy link
Contributor

@ziegenberg

I'll have a look at it

Do you have concerns?

No, no concerns. Lucky me, I only just managed to catch Covid and am now slowly recovering from it. So I was knocked out for a couple of days and was not able to answer. Sorry :(


1. ``platforms[*].image``: Docker image name:tag to use as base image.
2. ``platforms[*].pre_build_image``: Whether to customize base image or use
as-is[^1].
Copy link

Choose a reason for hiding this comment

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

Hey @timblaktu, thank you for this PR!

As this PR is already closed, I am not sure if this is the right place to mention this.
But let me do it anyway, if I should create a separate issue/PR, just let me know.

The footnotes in this PR do not render correctly in https://molecule.readthedocs.io/en/latest/examples.html.

The documentation is composed as SphinxDoc/reStructuredText the footnote reference should look like this: [#name]_.

For example, this line could look like this:

as-is `[#dockerimplementation]_`.


Append the following code block to the end of ``Dockerfile.j2``. It creates an
``ansible`` user with passwordless sudo privileges. Note the variable
``SUDO_GROUP`` depends on the target distribution[^2].
Copy link

Choose a reason for hiding this comment

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

... and this, like this:

``SUDO_GROUP`` depends on the target distribution [#sudogroup]_.

Comment on lines +430 to +432

[^1]: [Implementation in molecule-docker](https://github.com/ansible-community/molecule-docker/blob/f4efce3c4fda226c8ca5f10976927fff7daa8e69/src/molecule_docker/playbooks/create.yml#L35)
[^2]: e.g. [Debian uses `sudo` instead of `wheel` group.](https://wiki.debian.org/sudo/)
Copy link

Choose a reason for hiding this comment

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

And the footnote body should then look like this:

.. [#dockerimplementation]: `Implementation in molecule-docker <https://github.com/ansible-community/molecule-docker/blob/f4efce3c4fda226c8ca5f10976927fff7daa8e69/src/molecule_docker/playbooks/create.yml#L35>`_)
.. [#sudogroup]: e.g. `Debian uses `sudo` instead of `wheel` group. <https://wiki.debian.org/sudo/>`_

Note, that inline (external) web links also look different in SphinxDoc/rST. I also updated the links.

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.

Provide basic information about Dockerfile template and pre_build_image driver option
6 participants