---
# System prepended metadata

title: Build containers locally

---

# Build containers locally

## Packages you need to have installed
```shell
sudo dnf install python-openstackclient buildah
```

## Installing the repo-setup

First, you need to clone the repo-setup repository

```shell
git clone https://github.com/openstack-k8s-operators/repo-setup
```

Then you need to configure a pip environment (I use mkvirtualenv, you can use whatever you want)

```shell
mkvirtualenv repo-setup
```

Then install it
```shell
pip install .
```

Create a temporary directory to be used by repo-setup:

```shell
mkdir /tmp/repos
```

Run the repo-setup with whatever configuration you want, for example:

```shell
repo-setup current-podified -b antelope -o /tmp/repos
```

## TCIB

Clone the tcib and run it. Unfortunately you `MUST` run as sudo, I tired to run with an env, but it did not work, and I did not want to digg too much into it

```
git clone https://github.com/openstack-k8s-operators/tcib
sudo python setup.py install
```

Hack your container, and then you can create a containers.yml file with the name of the containers you want to build locally.

```yaml=
container_images:
  - imagename: quay.io/podified-master-centos9/openstack-base:current-podified
  - imagename: quay.io/podified-master-centos9/openstack-tempest:current-podified
```

Build your container
```shell
openstack tcib container image build --config-file containers_tempest.yaml --repo-dir /tmp/repos/ --registry quay.io --volume /usr/share/tcib/container-images:/usr/share/tcib/container-images:z
```

Now, this container image will be available only in podman as root, all you have to do now, if you want to use the container with your normal user is scp it:

```
podman image scp root@localhost::quay.io/podified-master-centos9/openstack-tempest arxcruz@localhost::
```

Profit!