-
Notifications
You must be signed in to change notification settings - Fork 67
Implementation for podman to be used for container images #1357
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
Conversation
Signed-off-by: Jordan Dubrick <[email protected]>
Signed-off-by: Jordan Dubrick <[email protected]>
Signed-off-by: Jordan Dubrick <[email protected]>
@@ -34,8 +34,8 @@ Release details and process are found in [Devfile Release](RELEASE.md) | |||
|
|||
## How to build |
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.
this section is duplicating the content in contributing doc. We shouldn't spent effort to maintain same content in separate docs. Please use the link to contributing.md, e.g. ./CONTRIBUTING.md#building
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.
I agree about the duplication :) Thinking that in general the contribution guidelines are more related to information about how someone could open a PR or an issue, I was wondering if the contributing.md
is the right file to maintain this section? WDYT?
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.
Thank you for pointing that out! To remove the duplication I agree with contributing.md probably not being the right spot for the build instructions, I'll remove it from contributing and keep in in the readme.md
only
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.
@yangcao77 @thepetk please see the latest commit for my updated changes.
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.
should directly link to the building
section. not the top of the contributing doc
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.
generally looks good, left a comment on the doc
Signed-off-by: Jordan Dubrick <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1357 +/- ##
=======================================
Coverage 35.75% 35.75%
=======================================
Files 52 52
Lines 6696 6696
=======================================
Hits 2394 2394
Misses 4158 4158
Partials 144 144 ☔ View full report in Codecov by Sentry. |
docker-run.sh
Outdated
# Run script to set env var for podman if necessary | ||
. ./setenv.sh | ||
|
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.
I'm not sure I like hiding the alias in a separate script and controlled by an env var -- it's hiding a lot of functionality here (if you don't notice these two lines at the top it looks like it just uses docker).
setenv.sh
Outdated
podman=${USE_PODMAN:-false} | ||
if [ ${podman} == true ]; then | ||
alias docker=podman | ||
echo "setting alias docker=podman" | ||
fi |
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.
Why not inline this?
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.
I do have the same question, why using a separate script just for setting alias?
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.
The reasoning for having it in a separate script was only because I was going off of prior work done here by someone else. That repo utilizes the same setenv.sh
script being used alongside an env variable to toggle between podman or docker.
If it's preferred to be inline that change can definitely be made.
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.
The way I've usually done it in other repos is to just use a variable, e.g.
DOCKER=docker
if [ <use podman condition> ]; then
DOCKER=podman
fi
$DOCKER build -t <image> -f <file> <context>
this also avoids the need for setting shopt -s expand_alias
.
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.
In my last commit I added the setting of the alias inline so we don't need another script to be doing that work. I initially tried to go with your way @amisevsk with the use of a variable but found that when it was trying to call the ./build.sh
script it was failing with a seg fault, this was not happening with setting the alias. I'm not sure why so more investigation will have to be done into that if we want to not use an alias and rather a variable.
Signed-off-by: Jordan Dubrick <[email protected]>
Signed-off-by: Jordan Dubrick <[email protected]>
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.
look good to me. thx for the changes
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: amisevsk, Jdubrick, yangcao77 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What does this PR do?
This PR enables the use of podman for container images instead of explicitly docker.
Which issue(s) does this PR fix
resolves #1341
PR acceptance criteria
Testing and documentation do not need to be complete in order for this PR to be approved. We just need to ensure tracking issues are opened.
How to test changes / Special notes to the reviewer
Run
bash ./docker-run.sh ./build.sh
withexport USE_PODMAN=true
for podman testing andexport USE_PODMAN=false
for docker.