# Python - Mkdocs

**URL:** <https://forum.buildkite.community/t/python-mkdocs/3830>\
**Category:** General\
**Created:** [August 1, 2024, 8:40am UTC](https://forum.buildkite.community/t/python-mkdocs/3830 "2024-08-01T08:40:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fansari1](https://avatars.discourse-cdn.com/v4/letter/f/65b543/32.png) [@fansari1](https://forum.buildkite.community/u/fansari1)\
**Post date:** [August 1, 2024, 8:40am UTC](https://forum.buildkite.community/t/python-mkdocs/3830/1 "2024-08-01T08:40:42Z")

</div>

Hi,  
I am new to Buildkite.  
I’m trying to checkout my docs repo in Buildkite and install Python.

My next steps in buildkite would be to install mkdocs and run `mkdocs gh-deploy`.

I am trying to run all these steps into a single job using Python docker image but it launches a Python shell in the container and the jobs run until infinity.

Can someone please explain what am I doing incorrectly here?

Thanks.

```auto
steps:
  - label: ":shrek: Deploy docs"
    key: "mkdocs-deploy-docs"
    plugins:
      - docker#v5.9.0:
          image: "python"
          commands: |
            #!/bin/bash
            echo --- Installing dependencies
            pip install -r requirements.txt
            mkdocs gh-deploy

```

---

<div class="post-metadata">

**Author:** ![tomwatt](https://avatars.discourse-cdn.com/v4/letter/t/c68b51/32.png) [@tomwatt](https://forum.buildkite.community/u/tomwatt)\
**Post date:** [August 1, 2024, 5:21pm UTC](https://forum.buildkite.community/t/python-mkdocs/3830/2 "2024-08-01T17:21:16Z")

</div>

Hey @fansari1

Welcome to the Buildkite Community forums!

Thanks for reaching out about running commands using a Python container image.

With the Docker plugin there are two ways in which commands can be run in the container itself, using the `command` attribute on the Step or in the `command` parameter in the Plugin config but they are run differently.

What you can do is put the commands in the `command` attribute of the Step instead e.g.,

```auto
steps:
  - label: ":shrek: Deploy docs"
    key: "mkdocs-deploy-docs"
    commands: |
      echo --- Installing dependencies
      pip install -r requirements.txt
      mkdocs gh-deploy
    plugins:
      - docker#v5.9.0:
          image: "python"    

```

The reason for this is whilst using the Plugin, the commands from the Step get translated into the docker run command to run the container using a shell e.g.,

```auto
python /bin/sh -e -c $'echo --- Installing dependencies\npip install -r requirements.txt\nmkdocs gh-deploy\n'

```

This then overrides the entrypoint in the image, which for the Python image is the python shell.

Alternative you could use the `command` parameter in the Plugin config, but this needs to be an array e.g., `["/bin/mycommand", "-c", "test"]` and this requires specifying which binary to use e.g., `/bin/sh` instead, followed by arguements.

More details on that here:

> **[GitHub - buildkite-plugins/docker-buildkite-plugin at v5.9.0](https://github.com/buildkite-plugins/docker-buildkite-plugin/tree/v5.9.0?tab=readme-ov-file#command-optional-array)**
>
> v5.9.0

Hope that helps, but let us know.

Cheers,

Tom

---

<div class="post-metadata">

**Author:** ![fansari1](https://avatars.discourse-cdn.com/v4/letter/f/65b543/32.png) [@fansari1](https://forum.buildkite.community/u/fansari1)\
**Post date:** [August 5, 2024, 9:40pm UTC](https://forum.buildkite.community/t/python-mkdocs/3830/3 "2024-08-05T21:40:59Z")

</div>

Thanks a lot @tomwatt !!

I was able to run the commands as I intended to.
