I struggled a bit to get the example running from the README.md.
docker run -it --rm \
--volume $(pwd):/app:rw
ghcr.io/slok/kube-code-generator:v0.2.0 \
--apis-in ./apis --go-gen-out ./client --crd-gen-out ./manifests
was leading to a permission error the container was prepared to address by starting as follows:
docker run -it --rm \
--user $(id -u):$(id -g) \
--volume $(pwd):/app:rw \
ghcr.io/slok/kube-code-generator:v0.2.0 \
--apis-in ./apis --go-gen-out ./client --crd-gen-out ./manifests
However, this does not fix the issue, since the container tries to create the user .cache in the root directory now, which fails the same way with a permission error. So finally, I came up with
docker run -it --rm \
--env HOME=/app \
--user $(id -u):$(id -g) \
--volume $(pwd):/app:rw \
ghcr.io/slok/kube-code-generator:v0.2.0 \
--apis-in ./apis --go-gen-out ./client --crd-gen-out ./manifests
Which is working.
@slok May be you like to fix this in the Dockerfile and improve the documentation.
I struggled a bit to get the example running from the README.md.
docker run -it --rm \ --volume $(pwd):/app:rw ghcr.io/slok/kube-code-generator:v0.2.0 \ --apis-in ./apis --go-gen-out ./client --crd-gen-out ./manifestswas leading to a permission error the container was prepared to address by starting as follows:
However, this does not fix the issue, since the container tries to create the user
.cachein the root directory now, which fails the same way with a permission error. So finally, I came up withWhich is working.
@slok May be you like to fix this in the
Dockerfileand improve the documentation.