container-magic 4.2.0__tar.gz → 4.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {container_magic-4.2.0/src/container_magic.egg-info → container_magic-4.2.2}/PKG-INFO +1 -1
- {container_magic-4.2.0 → container_magic-4.2.2}/pyproject.toml +1 -1
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/cli/main.py +8 -1
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/generators/dockerfile.py +12 -1
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/templates/Dockerfile.j2 +6 -0
- {container_magic-4.2.0 → container_magic-4.2.2/src/container_magic.egg-info}/PKG-INFO +1 -1
- {container_magic-4.2.0 → container_magic-4.2.2}/LICENSE +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/README.md +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/setup.cfg +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/__init__.py +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/cli/__init__.py +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/core/__init__.py +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/core/builder.py +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/core/cache.py +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/core/config.py +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/core/registry.py +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/core/runner.py +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/core/runtime.py +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/core/steps.py +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/core/symlinks.py +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/core/templates.py +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/core/volumes.py +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/generators/__init__.py +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/generators/build_script.py +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/generators/run_script.py +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/registry/__init__.py +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/templates/_macros.j2 +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/templates/build.sh.j2 +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/templates/run.sh.j2 +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic.egg-info/SOURCES.txt +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic.egg-info/dependency_links.txt +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic.egg-info/entry_points.txt +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic.egg-info/requires.txt +0 -0
- {container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "container-magic"
|
|
7
|
-
version = "4.2.
|
|
7
|
+
version = "4.2.2"
|
|
8
8
|
description = "A tool for rapidly creating containerised development environments"
|
|
9
9
|
authors = [
|
|
10
10
|
{name = "Mark Hedley Jones", email = "mark@hedleyjones.com"}
|
|
@@ -363,7 +363,14 @@ def clean():
|
|
|
363
363
|
clean_images(config)
|
|
364
364
|
|
|
365
365
|
|
|
366
|
-
@cli.command(
|
|
366
|
+
@cli.command(
|
|
367
|
+
"run",
|
|
368
|
+
context_settings=dict(
|
|
369
|
+
ignore_unknown_options=True,
|
|
370
|
+
allow_extra_args=True,
|
|
371
|
+
help_option_names=[],
|
|
372
|
+
),
|
|
373
|
+
)
|
|
367
374
|
@click.argument("args", nargs=-1, type=click.UNPROCESSED)
|
|
368
375
|
def cli_run(args):
|
|
369
376
|
"""Run a command in the development container."""
|
{container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/generators/dockerfile.py
RENAMED
|
@@ -427,7 +427,18 @@ def generate_dockerfile(
|
|
|
427
427
|
|
|
428
428
|
# Chown venv to runtime user in leaf stages so it's writable in development
|
|
429
429
|
if has_user and stage_name in leaf_stages and venv_active:
|
|
430
|
-
|
|
430
|
+
# Determine if we're in a non-root context (inherited from parent)
|
|
431
|
+
last_become_user = None
|
|
432
|
+
for s in reversed(ordered_steps):
|
|
433
|
+
if s.get("type") == "become":
|
|
434
|
+
last_become_user = s.get("name")
|
|
435
|
+
break
|
|
436
|
+
inherited_context = _get_parent_user_context(stage_name, stages, user_name)
|
|
437
|
+
is_root = last_become_user is None and inherited_context is None
|
|
438
|
+
chown_step = {"type": "venv_chown", "is_root": is_root}
|
|
439
|
+
if not is_root:
|
|
440
|
+
chown_step["restore_user"] = last_become_user or inherited_context
|
|
441
|
+
ordered_steps.append(chown_step)
|
|
431
442
|
|
|
432
443
|
# Inject implicit become at end of leaf stages only
|
|
433
444
|
# Intermediate stages stay as root so child stages inherit root context
|
|
@@ -133,7 +133,13 @@ ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
|
|
|
133
133
|
USER {{ step.restore_user }}
|
|
134
134
|
{% endif %}
|
|
135
135
|
{% elif step.type == "venv_chown" %}
|
|
136
|
+
{% if not step.is_root %}
|
|
137
|
+
USER root
|
|
138
|
+
{% endif %}
|
|
136
139
|
RUN chown -R "${USER_UID}:${USER_GID}" /opt/venv
|
|
140
|
+
{% if not step.is_root %}
|
|
141
|
+
USER {{ step.restore_user }}
|
|
142
|
+
{% endif %}
|
|
137
143
|
{% elif step.type == "custom" %}
|
|
138
144
|
{% if step.command.startswith('ADD ') or step.command.startswith('ARG ') or step.command.startswith('CMD ') or step.command.startswith('COPY ') or step.command.startswith('ENTRYPOINT ') or step.command.startswith('ENV ') or step.command.startswith('EXPOSE ') or step.command.startswith('FROM ') or step.command.startswith('HEALTHCHECK ') or step.command.startswith('LABEL ') or step.command.startswith('RUN ') or step.command.startswith('SHELL ') or step.command.startswith('STOPSIGNAL ') or step.command.startswith('USER ') or step.command.startswith('VOLUME ') or step.command.startswith('WORKDIR ') %}
|
|
139
145
|
{{ step.command }}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/generators/build_script.py
RENAMED
|
File without changes
|
{container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic/generators/run_script.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{container_magic-4.2.0 → container_magic-4.2.2}/src/container_magic.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|