-
Notifications
You must be signed in to change notification settings - Fork 12
feat(pde2e-image): add docker and podman-compose install scripts for RHEL #581
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
Open
amisskii
wants to merge
1
commit into
podman-desktop:main
Choose a base branch
from
amisskii:add-cli-preinstallation-scripts
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+39
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| echo "Installing Docker Engine on RHEL..." | ||
|
|
||
| echo "Installing dnf-plugins-core..." | ||
| sudo dnf -y install dnf-plugins-core | ||
|
|
||
| echo "Adding Docker CE repository..." | ||
| sudo dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo | ||
|
|
||
| echo "Installing Docker Engine packages..." | ||
| sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | ||
|
|
||
| echo "Starting and enabling Docker service..." | ||
| sudo systemctl enable --now docker | ||
|
|
||
| echo "Adding current user to docker group..." | ||
| sudo usermod -aG docker "$(whoami)" | ||
|
|
||
| docker --version | ||
| echo "Docker Engine installation complete." |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| echo "Installing podman-compose..." | ||
|
|
||
| if sudo dnf install -y podman-compose 2>/dev/null; then | ||
| echo "podman-compose installed via dnf." | ||
| else | ||
| echo "dnf installation failed, falling back to pip..." | ||
| sudo dnf install -y python3-pip | ||
| pip3 install --user podman-compose | ||
| export PATH="$HOME/.local/bin:$PATH" | ||
| fi | ||
|
|
||
| podman-compose --version | ||
| echo "podman-compose installation complete." | ||
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.
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.
PATH export doesn't persist after script exits.
Line 12 exports
PATHto include$HOME/.local/bin, but this only affects the current script session. When the script exits, the parent shell'sPATHremains unchanged, makingpodman-composeunavailable despite successful installation via pip.The version check at line 15 succeeds within the script's environment, masking this issue.
🔧 Proposed fix to persist PATH changes
Add persistence logic after the pip installation:
echo "dnf installation failed, falling back to pip..." sudo dnf install -y python3-pip pip3 install --user podman-compose - export PATH="$HOME/.local/bin:$PATH" + + # Persist PATH for future sessions + if ! grep -q '$HOME/.local/bin' "$HOME/.bashrc" 2>/dev/null; then + echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$HOME/.bashrc" + echo "Added $HOME/.local/bin to PATH in ~/.bashrc" + fi + + # Update PATH for current and subsequent commands in this script + export PATH="$HOME/.local/bin:$PATH" fiAlternatively, document that users must manually add
$HOME/.local/binto their PATH after installation.📝 Committable suggestion
🤖 Prompt for AI Agents