Skip to content

Commit

Permalink
Fixes for podman in build-dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsuresh committed Dec 29, 2024
1 parent d1beb68 commit 553c24a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions script/build-dockerfile/_cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ input_mapping:
new_env_keys:
- CM_DOCKERFILE_*

deps:
- tags: get,docker
names:
- docker

post_deps:
- enable_if_env:
CM_BUILD_DOCKER_IMAGE:
Expand Down
6 changes: 4 additions & 2 deletions script/build-dockerfile/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,10 @@ def preprocess(i):
docker_user = get_value(env, config, 'USER', 'CM_DOCKER_USER')
docker_group = get_value(env, config, 'GROUP', 'CM_DOCKER_GROUP')

if docker_user and str(env.get('CM_DOCKER_USE_DEFAULT_USER', '')).lower() not in [
"yes", "1", "true"]:
if env.get('CM_CONTAINER_TOOL', '') == 'podman' and env.get('CM_DOCKER_USE_DEFAULT_USER', '') == '':
env['CM_DOCKER_USE_DEFAULT_USER'] = 'yes'

if docker_user and str(env.get('CM_DOCKER_USE_DEFAULT_USER', '')).lower() not in ["yes", "1", "true"]:

f.write('RUN groupadd -g $GID -o ' + docker_group + EOL)

Expand Down

0 comments on commit 553c24a

Please sign in to comment.