Quickstart guide and demo for Portward.
Warning
Project is under development. Backwards compatibility is not guaranteed.
Download an image archive (for example alpine) that you can push to registries.
Using skopeo:
mkdir -p var/ skopeo --insecure-policy copy -a docker://docker.io/library/alpine:latest oci-archive://$PWD/var/alpine.tar.gzUsing regctl:
mkdir -p var/ regctl image export docker.io/library/alpine:latest $PWD/var/alpine.tar.gzFor an optimal developer experience, it is recommended to install Nix and direnv.
Create a config.yaml file:
cp config.example.yaml config.yamlImportant
Restart portward using docker compose restart portward if you change anything in config.yaml.
Start Docker Compose:
docker compose up -dNote
Check the docker-compose.yaml file for ports and make sure they are not in use.
Make sure containers are started:
docker compose psDecide which registry you want to use:
- Distribution:
export REGISTRY=127.0.0.1:5000 - Zot:
export REGISTRY=127.0.0.1:5001
Log in to the registry as admin:
# Using skopeo skopeo login --tls-verify=false -u admin -p password $REGISTRY # Using regctl regctl registry set --tls=disabled $REGISTRY regctl registry login -u user -p password $REGISTRYPush images to the registry:
# Using skopeo skopeo --insecure-policy copy --dest-tls-verify=false -a oci-archive://$PWD/var/alpine.tar.gz docker://$REGISTRY/alpine skopeo --insecure-policy copy --dest-tls-verify=false -a oci-archive://$PWD/var/alpine.tar.gz docker://$REGISTRY/product1/alpine # Using regctl regctl image import $REGISTRY/alpine $PWD/var/alpine.tar.gz regctl image import $REGISTRY/product1/alpine $PWD/var/alpine.tar.gzLogout as admin from the registry:
# Using skopeo skopeo logout $REGISTRY # Using regctl regctl registry logout $REGISTRYLog in to the registry as user:
# Using skopeo skopeo login --tls-verify=false -u user -p password $REGISTRY # Using regctl regctl registry set --tls=disabled $REGISTRY regctl registry login -u user -p password $REGISTRYInspect and pull images in the registry:
# Using skopeo skopeo --insecure-policy --override-os linux --override-arch amd64 inspect --tls-verify=false docker://$REGISTRY/alpine skopeo --insecure-policy copy --src-tls-verify=false -a docker://$REGISTRY/alpine oci-archive:///dev/null # Using regctl regctl image inspect $REGISTRY/alpine regctl image export $REGISTRY/alpine /dev/nullTry pulling an image user does not have access to:
# Using skopeo skopeo --insecure-policy --override-os linux --override-arch amd64 inspect --tls-verify=false docker://$REGISTRY/product1/alpine skopeo --insecure-policy copy --src-tls-verify=false -a docker://$REGISTRY/product1/alpine oci-archive:///dev/null # Using regctl regctl image inspect $REGISTRY/product1/alpine regctl image export $REGISTRY/product1/alpine /dev/nullPush an image to the registry:
# Using skopeo skopeo --insecure-policy copy --dest-tls-verify=false -a oci-archive://$PWD/var/alpine.tar.gz docker://$REGISTRY/user/alpine # Using regctl regctl image import $REGISTRY/user/alpine $PWD/var/alpine.tar.gzTry pushing an image that user does not have access to:
# Using skopeo skopeo --insecure-policy copy --dest-tls-verify=false -a oci-archive://$PWD/var/alpine.tar.gz docker://$REGISTRY/alpine # Using regctl regctl image import $REGISTRY/alpine $PWD/var/alpine.tar.gzLogout as user from the registry:
# Using skopeo skopeo logout $REGISTRY # Using regctl regctl registry logout $REGISTRYLog in to the registry as customer:
# Using skopeo skopeo login --tls-verify=false -u customer -p password $REGISTRY # Using regctl regctl registry set --tls=disabled $REGISTRY regctl registry login -u customer -p password $REGISTRYInspect and pull images in the registry:
# Using skopeo skopeo --insecure-policy --override-os linux --override-arch amd64 inspect --tls-verify=false docker://$REGISTRY/product1/alpine skopeo --insecure-policy copy --src-tls-verify=false -a docker://$REGISTRY/product1/alpine oci-archive:///dev/null # Using regctl regctl image inspect $REGISTRY/product1/alpine regctl image export $REGISTRY/product1/alpine /dev/nullTry pulling an image customer does not have access to:
# Using skopeo skopeo --insecure-policy --override-os linux --override-arch amd64 inspect --tls-verify=false docker://$REGISTRY/alpine skopeo --insecure-policy copy --src-tls-verify=false -a docker://$REGISTRY/alpine oci-archive:///dev/null # Using regctl regctl image inspect $REGISTRY/alpine regctl image export $REGISTRY/alpine /dev/nullTry pushing an image as customer:
# Using skopeo skopeo --insecure-policy copy --dest-tls-verify=false -a oci-archive://$PWD/var/alpine.tar.gz docker://$REGISTRY/customer/alpine # Using regctl regctl image import $REGISTRY/customer/alpine $PWD/var/alpine.tar.gzLogout as customer from the registry:
# Using skopeo skopeo logout $REGISTRY # Using regctl regctl registry logout $REGISTRYTear down the Docker Compose setup:
docker compose down -vRemove files:
rm -rf var/The project is licensed under the MIT License.