Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

che-incubator/custom-native-editor-base-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Custom Native Editor Base Image

Base image to run desktop application inside a container in Eclipse Che.

Table of Contents

About The Project

Screenshot

This repository is a starting point to build an image with custom desktop application that runs in a container inside Eclipse Che.

The image itself works in cooperation with devfile as image for components that has type cheEditor.

Built With

Getting Started

This is the flow of how you may build and test base editor image.

Build

  1. Clone the repo
git clone https://github.com/che-incubator/custom-native-editor-base-image && cd custom-native-editor-base-image
  1. Build image with docker
docker build -t custom-native-editor-base-image .
  1. Run built container
docker run -it -p 8080:8080 custom-native-editor-base-image
  1. Navigate to run container
http://localhost:8080/vnc.html?resize=remote&autoconnect=1

Usage

Below provided an example how to use base editor image to create custom editor image based on the vim editor.

Source code of example provided in /example directory.

  1. Create file Dockerfile
FROM custom-native-editor-base-image:latest

# Set up root user to have an ability to install necessary packages
USER root

# Perform package install and copy supervisor configuration
RUN yum install -y vim && yum clean all
COPY --chown=0:0 vim.conf /etc/supervisord.d/vim.conf

# Setup correct user
USER 1001
  1. Create file vim.conf
[program:vim]
command=xterm -display :0 -e /bin/bash -l -c "vim"
stdout_logfile=/tmp/vim.log
stderr_logfile=/tmp/vim.log
user=user
environment=DISPLAY=":0"
autorestart=true
priority=999
  1. Build an image
docker build -t vim-custom-editor .
  1. Run image
docker run -it -p 8080:8080 vim-custom-editor
  1. Navigate to run container
http://localhost:8080/vnc.html?resize=remote&autoconnect=1

xterm

  1. Push image to public registry
docker tag vim-custom-editor:latest <username>/vim-custom-editor:latest
docker push <username>/vim-custom-editor:latest
  1. Create file meta.yaml and upload it to have a public access to it, e.g. to https://gist.github.com/
apiVersion: v2
publisher: <username>
name: vim-NOVNC
version: 1.0
type: Che Editor
displayName:  Vim
title:  Vim (in browser using noVNC) as editor for Eclipse Che
description:  Vim running on the Web with noVNC
icon: https://raw.githubusercontent.com/vim/vim/master/runtime/vimlogo.gif
category: Editor
repository: https://github.com/che-incubator/custom-native-editor-base-image
firstPublicationDate: "2020-11-03"
spec:
  endpoints:
   -  name: "dirigible"
      public: true
      targetPort: 8080
      attributes:
        protocol: http
        type: ide
        path: /vnc.html?resize=remote&autoconnect=true&reconnect=true
  containers:
   - name: vim-novnc
     image: "<username>/vim-custom-editor:latest"
     mountSources: true
     ports:
         - exposedPort: 8080
     memoryLimit: "1024M"
  1. Create file devfile.yaml
metadata:
  name: vim-workspace
components:
  - type: cheEditor
    reference: '<url for meta.yaml goes here>'
    alias: theia-editor
apiVersion: 1.0.0
  1. Navigate to https://che.openshift.io/ and create a workspace from current devfile.yaml

xterm in che.openshift.io

Roadmap

See the open issues for a list of proposed features (and known issues).

License

Distributed under the Eclipse Public License - v 2.0 license. See LICENSE for more information.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published