Skip to content

[one-cmds] Introduce onecc-docker binary and one-compiler-docker package #8232

@jyoungyun

Description

@jyoungyun

What

Let's consider how to use one-cmds tools easily for more people.

For now, one-cmds tools only support Ubuntu 18.04 and 20.04(not officially).
So people in other environments can't use our tools unless they upgrade the OS (or install Ubuntu OS).

IMO, in this case, docker can be a good solution.

Docker is an open source containerization platform. It supports developer to provide applications into containers. And docker is already available on a variety of Linux platforms, macOS and Windows 10 through Docker Desktop. So if we provide one-compiler tool using docker, we can support many types of environment at once.

How

Dockerfile

  • Based on Ubuntu 18.04 or 20.04
  • Install one-compiler
  • Set onecc as entrypoint

This dockerfile generates a docker image for one-compiler on Ubuntu 18.04 or 20.04.
User can run a process in isolated container using this docker image with several onecc parameters.

onecc-docker tool

  • Run docker container with onecc parameters and several docker run params

This onecc-docker tool runs docker container using above docker image. It sets user and group ids the same as those on host PC, mounts /tmp and ${HOME} directory, adds HOME environment, and changes working directory to current directory.

one-compiler-docker package

  • files
    • Dockerfile
    • onecc-docker files
  • install
    • Dockerfile to /usr/share/one/docker/
    • onecc-docker to /usr/share/one/bin/
  • postinst
    • Install symbolic link from /usr/share/one/bin/onecc-docker to /usr/bin/onecc with priority 0 using update-alternatives tool
  • prerm
    • Remove symbolic link

one-compiler package

  • postinst
    • Install symbolic link from /usr/share/one/bin/onecc to /usr/bin/onecc with priority 1 using update-alternatives tool
      (1 is higher priority than 0)
  • prerm
    • Remove symbolic link

Todo

  • dockerfile apt-source and version management

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions