Created
April 30, 2024 20:27
-
-
Save dcasati/472b8cd8194917cc54f473100610c037 to your computer and use it in GitHub Desktop.
run podman in a pod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to run podman in a pod | |
# create a priviledge pod | |
cat <<EOF | kubectl apply -f - | |
kind: Pod | |
apiVersion: v1 | |
metadata: | |
name: adcirc-debug | |
spec: | |
containers: | |
- image: ubuntu:latest | |
name: adcirc-debug | |
securityContext: | |
privileged: true | |
command: | |
- /bin/sh | |
- -c | |
- | | |
apt update ; apt install -y infiniband-diags vim podman fuse-overlayfs; sleep 3600; | |
EOF | |
# exec into the container | |
kubectl exec -it podman | |
# modify the registy.conf | |
sed -i 's/# unqualified-search-registries = \["example.com"\]/unqualified-search-registries = \["docker.io"\]/' /etc/containers/registries.conf | |
# build the container | |
podman build --format docker -t stormbreakeracrdc.azurecr.io/adcird-tests:55.dev.openmpi-beta-3 . | |
# login to ACR and push the container to the registry | |
podman login ${YOUR_AZURE_CONTAINER_REGISTRIY} -u ${ACR_USER} | |
podman push stormbreakeracrdc.azurecr.io/adcird-tests:55.dev.openmpi-beta-3 | |
cat <<EOF > /etc/containers/storage.conf | |
[storage] | |
driver = "overlay" | |
graphroot = "/mnt/var/lib/containers/storage" | |
[storage.options.overlay] | |
mount_program = "/usr/bin/fuse-overlayfs" | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment