Build an image with umoci and skopeo
docker build -t mariolet/umoci .
docker push mariolet/umoci
Login to the OpenShift cluster and start the container based on the image we just built
oc login <OPENSHIFT_API> -t <TOKEN>
oc run -i -t test --image=mariolet/umoci \
--restart=Never --rm=true \
--command -- bash
Git clone a plugin project
mkdir -p /tmp/project && cd /tmp/project/
export GIT_COMMITTER_NAME=l0rd && \
export GIT_COMMITTER_EMAIL=mario.loriedo@gmail.com && \
git clone https://github.com/ws-skeleton/che-service-plugin.git && \
cd che-service-plugin/service/
Build the image
# Set DockerHub credentials
DOCKERHUB_USER=<login>
DOCKERHUB_PASSWORD=<password>
# Pull and unpackl the base image (node:10.7-alpine)
skopeo copy docker://node:10.7-alpine oci:che-hello-plugin:latest && \
umoci unpack --rootless --image che-hello-plugin:latest bundle
# COPY
mkdir ./bundle/rootfs/server && \
cp -r impl/* ./bundle/rootfs/server/
# RUN
cd ./bundle/rootfs/server/ && \
HOME=/tmp/project/ yarn install && \
cd -
# Repack and push the resluting image to Docker Hub
umoci repack --image che-hello-plugin:new bundle
skopeo copy --dcreds $DOCKERHUB_USER:$DOCKERHUB_PASSWORD \
oci:che-hello-plugin:new \
docker://$DOCKERHUB_USER/che-hello-plugin:new