-
Notifications
You must be signed in to change notification settings - Fork 12
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
Reworked docker docs #155
Merged
Merged
Reworked docker docs #155
Conversation
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
stefaniuk
force-pushed
the
alyo12-docker-docs
branch
from
April 17, 2024 12:51
29ef7b1
to
9964263
Compare
stefaniuk
previously approved these changes
Apr 17, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of good work went into this. The manual reads well. Approving this PR.
Some suggestions:
- Could we arrange for collegues who use the repo template to give us a feedback on the usage of the Docker module? I may ask the screening DToS team. We are also planning to implement devcontainers which may benefit from some of the functionality here.
- All the new docker scripts, can we include them in the
scripts/docker/tests/docker.test.sh
test suite?
stefaniuk
approved these changes
Oct 29, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Minor (but important!) changes to how docker is run,
DOCKER_IMAGE
handling, and some docs.Context
This change wraps up a few different changes I needed to make when using the template.
Docker context
Here we were
cd
ing into theinfrastructure/images/whatever
directory before running Docker. That restricts the docker context to only that directory and below. You can'tCOPY ../../. .
or whatever because that's treated as a security problem.This meant that you couldn't put your application code into a container inside the
infrastructure/images
structure. That's fine if you've got a single application container, and if you're happy with it living at the root of the repo, but as soon as you've got more than one it gets a bit messy (and I've never liked things that clutter the repo root at the best of times).The change I've made gets rid of the
cd
in and out;docker
is always run from the repo root. That means paths inDockerfile
s are relative to the root, not to themselves; same with.dockerignore
(which I've made optional so that it doesn't break if there isn't one).$DOCKER_IMAGE
variable handlingMinor tweak but a good quality of life improvement here. If you specify
$DOCKER_IMAGE
to themake docker-*
tasks but not$dir
then it defaults$dir
toinfrastructure/images/$DOCKER_IMAGE
. That means themake
invocation, the filesystem, and the docker image list are all synchronised to the same name, by convention.Updated docker usage docs
The example in the existing docs was specific to repackaging a third party tool, but gave no guidance about how to package your own application code. I've rewritten the
Quick start
section to show packaging a trivial python script. I'm a little worried that the docs are a bit repetitive now, but I don't think it's worth reworking right now.I've also removed the python example code. It was a good start, but in practice having the tutorial docs is better because what I want to know as a new user is where to put my own stuff, and the example wasn't a huge help there and in fact was a bit of a confusion.
Type of changes
Checklist
Sensitive Information Declaration
To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.