Z
Zerops13mo ago
Puub

Custom service

Hi, I was wondering if it is possible to create a custom image/service, for example a Docker image registry. Would be perfect if I can setup a private registry in 0ps and pull images into services from the same network
3 Replies
Aleš
Aleš13mo ago
I had this whole message written down, my internet disconnected and discord decided to reload, deleting my message... darn it, give me a second to write it again The way you create custom image is by starting with the “Ubuntu” service, which has Ubuntu (Jammy) on it (we will soon also support alpine), so a clean slate for you to create a custom image from. You would do this through zerops.yml, using the prepareCommands property available in both run and build sections, here you can install any dependency you need, do any configuration you need, the resulting image will be cached and used for the next build / all runtime containers. It essentially works like a Docker Hub built into Zerops.
zerops:
- setup: api
build:
prepareCommands:
- apt-get this-and-that
buildCommands:
- echo "building my app on top of the custom image"
deploy: ./
run:
prepareCommands:
- apt-get that-and-this
start: sh my-custom-start.sh
zerops:
- setup: api
build:
prepareCommands:
- apt-get this-and-that
buildCommands:
- echo "building my app on top of the custom image"
deploy: ./
run:
prepareCommands:
- apt-get that-and-this
start: sh my-custom-start.sh
This functionality will be further improved by having a place to pre-built your images, which will then just be referenced in your zerops.yml, i.e.
zerops:
- setup: api
build:
base: myCustomBuildImage@1
buildCommands:
- echo "building my app on top of the custom image"
deploy: ./
run:
base: myCustomRuntimeImage@2
start: sh my-custom-start.sh
zerops:
- setup: api
build:
base: myCustomBuildImage@1
buildCommands:
- echo "building my app on top of the custom image"
deploy: ./
run:
base: myCustomRuntimeImage@2
start: sh my-custom-start.sh
As for Docker, we currently do not support it, we are using full fledged Linux containers, instead of containerizing just a single process (which is what Docker is doing), you could run Docker inside our Linux container, but it would be virtualization on top of virtualization, which has security and performance implications. We eventually plan to support a Docker service, but for now usually I find it pretty easy to just copy the Dockerfile install instructions to my zerops.yml and it works without any problems most of the time. If you can explain in more detail what would you like to set up, I can try and give you the best way to do it.
Puub
PuubOP13mo ago
Aah thanks for clarifying, it now makes a lot more sense! It's been a while since I've worked with your tools, so I forgot about the underlying technologies. Very cool!
Aleš
Aleš13mo ago
here's a couple of recipes (example apps) you can try to re-explore Zerops with (put the yaml in readme into project import dialog), while we work on the new onboarding: --- Recipe with upload (shared and object storage) https://github.com/fxck/zerops-hello-upload Recipe with runtimes (nodejs, php, python, golang, dotnet) with write/read from PostgreSQL https://github.com/fxck/zerops-hello-worlds Recipe with WordPress (keydb, mariadb, php, object storage) https://github.com/fxck/zerops-hello-wordpress Recipe with Strapi (nodejs, postgres, object storage) https://github.com/fxck/zerops-hello-strapi

Did you find this page helpful?