Skip to content
This repository was archived by the owner on Jun 10, 2026. It is now read-only.
This repository was archived by the owner on Jun 10, 2026. It is now read-only.

Add support for docker as first class + use moby client API to manage and run containers #30

Description

@dnitsch

Taking the example below

# yaml-language-server: $schema=https://raw.githubusercontent.com/Ensono/taskctl/refs/heads/master/schemas/schema_v1.json

contexts:
  nouveau:container:
    container:
      name: alpine:latest
      # shell: "" 
      # shell_args:
      #   - ""
      # container_args:
      #   - ""
      # entrypoint: ""
      enable_dind: false

  # the executable property will not be removed
  # as it's handy for a lot of other use cases
  # 
  # It will however remove all the env-file injection and so on
  old:container:
    executable:
      bin: docker
      args:
        - run
        - --rm
        - -v $PWD:/app
        - -w /app 
        - alpine:latest
        - sh
        - -c

tasks:
  run:docker:mvdn: 
    command:
      - docker run --rm -v $PWD:/app -w /app alpine:latest sh -c "pwd && ls -lat ."
  
  run:container:nouveau: 
    context: nouveau:container
    command:
      - pwd
      - ls -lat .

  run:container:old: 
    context: old:container
    command:
      - pwd
      - ls -lat .

The above example shows the current way to do the same thing 3 different ways, by making containers first class citizens, we have introduced context.container property group. But have left a lot of workaround code in there to ensure things work with containers in all 3 ways.

This issue is about keeping all 3 ways but removing any container specific code from the other 2 and only context.container to include any special handling of container executions - it will also not run in the mvdn shell but use directly the moby client API

Metadata

Metadata

Assignees

No one assigned

    Labels

    2.x2.0 release

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions