Skip to content
Snippets Groups Projects
Unverified Commit 25cbdf26 authored by Vivek Dutta's avatar Vivek Dutta
Browse files

docs: local image registry for oci containers

parent 5819443a
No related branches found
No related tags found
1 merge request!82docs: local image registry for oci containers
Pipeline #100829 passed
...@@ -31,4 +31,101 @@ $ sudo -i ...@@ -31,4 +31,101 @@ $ sudo -i
## Sulu application container ## Sulu application container
An example makefile to generate sulu application container tar ball can be accessed [here](https://dev.iopsys.eu/iopsys/swmodd/-/blob/devel/examples/sulu/README.md) An example makefile to generate sulu application container tar ball can be accessed [here](https://dev.iopsys.eu/iopsys/swmodd/-/blob/devel/examples/sulu/README.md)
## Local application containers with multi-arch support
It is possible to create an multi-arch oci container and store it in Gitlab image registry, to support variety of devices and platforms.
This can be done in many ways, but in this example I am using docker buildx to build multi-arch containers.
### Pre-setup
1. Create a access-token with read/write access to image registry in gitlab
2. Install buildx
```bash
export BUILDX_VERSION="v0.10.4"
export BUILDX_ARCH="linux-amd64"
wget -O /usr/bin/docker-buildx https://github.com/docker/buildx/releases/download/${BUILDX_VERSION}/buildx-${BUILDX_VERSION}.${BUILDX_ARCH}
```
### Build
To build a multi-arch oci container and push to Gitlab image registry, run following commands, sulu example container used in this example:
```bash
$ docker-buildx create --use
$ cd examples/sulu
$ make extract
$ docker-buildx build --provenance=false --platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8 --tag dev.iopsys.eu:5050/lcm/swmodd/sulu:v2.1.2 --push .
```
Above commands creates sulu multi-arch containers and push it to Gitlab [image registry](https://dev.iopsys.eu/lcm/swmodd/container_registry/).
### Verify
Image details can be verified with docker manifest command:
```bash
vdutta@SW019:~$ docker manifest inspect dev.iopsys.eu:5050/lcm/swmodd/sulu
{
"schemaVersion": 2,
"mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
"manifests": [
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 1871,
"digest": "sha256:5d362624ae3d27ecea7486a6b8f6a103b7d52543574baa483dd9034402727eb5",
"platform": {
"architecture": "386",
"os": "linux"
}
},
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 1871,
"digest": "sha256:db776d064d0763874bca5f8c4a5f396e339a901350cbcc8714c5e19c3adcefc9",
"platform": {
"architecture": "amd64",
"os": "linux"
}
},
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 1871,
"digest": "sha256:0323e482ca40f631a46993736b65459554149ac1586f04042cf61e738236bc64",
"platform": {
"architecture": "arm",
"os": "linux",
"variant": "v5"
}
},
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 1871,
"digest": "sha256:63d6bcea175828b4a8034b874948e774e40eea8f71657c6e0d7a4d5881662db8",
"platform": {
"architecture": "arm",
"os": "linux",
"variant": "v6"
}
},
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 1871,
"digest": "sha256:29152f374de66400c489413c2fcddfd26b8edad4c048efea57b0c17f07aa05ed",
"platform": {
"architecture": "arm",
"os": "linux",
"variant": "v7"
}
}
]
}
vdutta@SW019:~$
```
Above output provides the sha1 hash per architechture, to use a specific image in device, it can be used with its sha checksum hash, like below
```bash
obuspa -c operate "Device.SoftwareModules.InstallDU(URL=docker://dev.iopsys.eu:5050/lcm/swmodd/sulu@sha256:0323e482ca40f631a46993736b65459554149ac1586f04042cf61e738236bc64)"
```
This installs sulu for arm/v5 arch.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment