Skip to content

xonsh/container

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xonsh containers

Docker images for xonsh — a Python-powered shell.

Built daily from the latest PyPI release for linux/amd64 and linux/arm64.

Containers

  • xonsh/xonsh — Base image. Minimal xonsh installation, suitable as a build base or for non-interactive scripts.
  • xonsh/xonsh-interactive — Interactive shell. Adds prompt_toolkit and pygments; history is disabled.
  • xonsh/xonsh-github-action — For GitHub Actions. Parses $GITHUB_EVENT, exposes $INPUT; PyGithub/gqlmod-ready.

Tags

Each image publishes the same set of tags:

  • latest / <version> — based on python:3 (Debian)
  • slim / <version>-slim — based on python:3-slim
  • alpine / <version>-alpine — based on python:3-alpine

<version> is the xonsh version on PyPI, e.g. 0.23.2.

Usage

Run xonsh once:

docker run --rm xonsh/xonsh -c 'echo $(uname -a)'

Interactive shell:

docker run --rm -it xonsh/xonsh-interactive

Mount the current directory and start an interactive session in it:

docker run --rm -it -v "$PWD:/work" -w /work xonsh/xonsh-interactive

Run a local .xsh script:

docker run --rm -v "$PWD:/work" -w /work xonsh/xonsh xonsh ./script.xsh

Pin a specific version and use the slim variant:

docker run --rm xonsh/xonsh:0.23.2-slim -c '2 + 2'

Use as a base image:

FROM xonsh/xonsh:alpine
RUN xpip install requests
COPY ./build.xsh /build.xsh
CMD ["xonsh", "/build.xsh"]

Use in GitHub Actions:

jobs:
  example:
    runs-on: ubuntu-latest
    container: xonsh/xonsh-github-action
    steps:
      - run: echo $GITHUB_EVENT['repository']['full_name']
        shell: xonsh {0}

Dev

Images are built and pushed to Docker Hub from .github/workflows/build.yml. The build script (rebuild.xsh) is itself a xonsh script, executed in CI via xonsh/actions — the GitHub Action that installs xonsh on the runner.