👨‍💻 Studentbox documentation

Search

Search IconIcon to open search

2023-04-22

Last updated Apr 23, 2023 Edit Source

Continuing yesterday’s work of refactoring to use pods. It’s been tough to find how to store the configuration for pods, as some config can be per image or shared between images. I’ve used a combination of labels, and scripts to generate a list of available config (internal/runtimes) with go generate. Now I should be able to finish the pod spawning.

I can now spawn Busybox with a specially crafted runtimes.Runtime.

Now I have an issue with a real example (lamp runtime) when pulling an image: I get a 403 error from ghcr.io. I think it’s because my computer’s config for /etc/containers/registries.conf don’t include ghcr.io. Wrong lead: just a bad URL… Working now.

I must have failed something, my data directory looks like this:

1
2
3
4
5
6
7
data/
├── sb-sinux-php-test-apache/
│  └── html/
├── sb-sinux-php-test-mysql/
│  └── db/
└── sb-sinux-php-test-php/
   └── html/

instead of this:

1
2
3
4
data/
├── sb-sinux-php-test
│  ├── html/
│  └── db/

That’s actually because I create directories by container name, not project. But let’s call it a day, it spawns my pod:

1
2
3
4
5
6
➜ podman ps -a --pod
CONTAINER ID  IMAGE                                                    COMMAND           CREATED        STATUS                    PORTS       NAMES                     POD ID        PODNAME
69160de186ff  localhost/podman-pause:4.5.0-1681856273                                    4 minutes ago  Up 4 minutes                          94a6f20e6260-infra        94a6f20e6260  sb-sinux-php-test
9e5d6767dcf6  ghcr.io/sinux-l5d/studentbox/runtime/lamp.apache:latest  httpd-foreground  4 minutes ago  Up 4 minutes                          sb-sinux-php-test-apache  94a6f20e6260  sb-sinux-php-test
ce7dc3b2157a  ghcr.io/sinux-l5d/studentbox/runtime/lamp.mysql:latest   mariadbd          4 minutes ago  Exited (1) 4 minutes ago              sb-sinux-php-test-mysql   94a6f20e6260  sb-sinux-php-test
24d716a69dd3  ghcr.io/sinux-l5d/studentbox/runtime/lamp.php:latest     php-fpm           4 minutes ago  Up 4 minutes                          sb-sinux-php-test-php     94a6f20e6260  sb-sinux-php-test