Working with Container Image
Publish Container Image
-
Login to OneDev docker registry:
$ docker login onedev.example.comLogin user needs to have package write permission over the project below
-
Then push image to desired repository under specified project:
$ docker push onedev.example.com/<project path>/<repository>:<tag>Param Explanation <project path> path of a project with package management enabled <repository> repository name of the image. Will be created automatically if not exist <tag> tag of the image -
To build and publish in CI/CD, add a Build Image step and choose registry output. Under More Settings → Registry Logins, add the OneDev server URL, user name
@job_token@, and a job secret containing an access token with package write permission for the destination project. Using the job token as the user name associates the package with the publishing build.For example, after checking out a repository containing a Dockerfile:
- !BuildImageStepname: Build and pushoutput: !RegistryOutputtags: '@server@/my-project/my-image:@build_number@'registryLogins:- registryUrl: '@server_url@'userName: '@job_token@'passwordSecret: package-tokencondition: SUCCESSFULReplace
my-project/my-imagewith your project path and image repository, and create thepackage-tokenjob secret before running the job.
If OneDev server is accessed via http protocol, please configure your docker daemon or buildx builder to work with insecure registry
Consume Published Image
Open Packages and select the image tag. The detail page shows its digest, platform, login command, and pull command:

Log in with package read permission, then pull the image:
docker login onedev.example.com
docker pull onedev.example.com/<project path>/<repository>:<tag>
The registry host must be reachable from Docker and any BuildKit containers. Configure OneDev's Server URL accordingly; localhost inside a container refers to that container, not the OneDev host.
Query Published Image
When query published images from package list page, Name represents repository of the image, and Version represents tag of the image.