Commit Graph

10 Commits

Author SHA1 Message Date
Siteshwar Vashisht 5be3f8d480 Fix a shellcheck warning about word splitting
Error: SHELLCHECK_WARNING (CWE-156): [#def2]
/etc/profile.d/podman-docker.sh:4:10: warning[SC2046]: Quote this to prevent word splitting.
    2|
    3|   if [ -z "${DOCKER_HOST-}" ]; then
    4|->     if [ $(id -u) -eq 0 ]; then
    5|   	export DOCKER_HOST=unix:///run/podman/podman.sock
    6|       else

Resolves: https://openscanhub.fedoraproject.org/task/52458/log/podman-5.4.2-1.fc43/scan-results.html#def2

Signed-off-by: Siteshwar Vashisht <svashisht@redhat.com>
2025-05-12 15:03:54 +02:00
Christoph Reiter 9c14d15f4c bin/docker: fix broken escaping and variable substitution
In #24034 more variables were added to the envsubst input, but there is no
escaping with envsubst, so the resulting bash script never used
XDG_CONFIG_HOME. Also it replaced HOME with the build time HOME env
var breaking the runtime subsitution, resulting in something bogus like:

[ -e "\${XDG_CONFIG_HOME-\/home/build/.config}/containers/nodocker" ]

Fix by telling envsubst to just replace BINDIR and ETCDIR and remove
the broken escaping in the envsubst input.

Signed-off-by: Christoph Reiter <reiter.christoph@gmail.com>
2024-12-07 15:21:51 +01:00
Nick Dimiduk 6ef0288ca6
bin/docker support warning message suppression from user config dir
The `bin/docker` command should also honor the presence of `$XDG_CONFIG_HOME/containers/nodocker` when considering whether it should print the warning message.

Signed-off-by: Nick Dimiduk <ndimiduk@gmail.com>
2024-09-22 15:24:14 +02:00
Georgi Chulkov 004c040ca2 Fix podman-docker.sh under -eu shells (fixes #23628)
Signed-off-by: Georgi Chulkov <git@gch.bg>
2024-08-15 17:15:52 +03:00
Daniel J Walsh ad55ba6eb2
Handle DOCKER_HOST environment for podman-docker package
Rootless users should be defaulted to point DOCKER_HOST at
$XDG_RUNTIME_DIR/podman/podman.sock

When podman-docker package is installed.

[NO NEW TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-02-12 16:05:38 -05:00
Michael Milton 3c9ce3e52a Edit the docker wrapper to use the install prefix
Signed-off-by: Michael Milton <michael.r.milton@gmail.com>
2023-03-31 10:06:17 +11:00
Stephen Person 0933f6c0bd
Update docker cli message for case where user creates directory
Check for any existing system object in docker script to clear warning message (Resolving PR comments)

[NO NEW TESTS NEEDED]

Signed-off-by: Stephen Person <stephen.person.12@cnu.edu>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-01-10 08:51:26 -05:00
Petr Kubat 8e54df5d91 docker: Double quote array expansions to avoid re-splitting elements
Signed-off-by: Petr Kubat <pkubat@redhat.com>
2018-10-05 11:00:27 +02:00
Daniel J Walsh 50fea69fbc Fix up docker compatibility messages
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1170
Approved by: mheon
2018-07-27 13:40:56 +00:00
Daniel J Walsh 0207e629ee Add support for mimicing docker CLI
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-01-18 07:01:48 -05:00