Giter Site home page Giter Site logo

docker-base's Introduction

Docker Baseimage

This docker image(s) provide a foundation for other Docker images. The image(s) will not add an full blown S6 layer (https://github.com/just-containers/s6-overlay), but an easy auto-user detection to mitigate possible quirks when mounting into the container, especially in a development environment.

The default folder is assumed to be /opt/application where any arbitrary application may reside in. Its UID and GID will be used for the application user.

The image also provides some simple bash helper to wait-for other services spawned through docker(-compose) and also some little helpers to run software as root run-as-root or as user run-as-user or reuse the process via exec as root exec-as-root or as user exec-as-user.

Images based on this container should use the provided package manager of the corresponding distribution to install applications if possible. The whole idea is to use pre packaged stuff instead of compiling everything. If you need that just use something more suited for that e.g. alpine. The benefit will be that a sysadmin is able setup a non-docker environment based on your Dockerfiles. This may be especially useful if docker is solely for development and should react as close as possible to any production server running the bare os used for the docker image (e.g CentOS).

The executing user which the container starts with is and has to be root, as it needs to have some permissions for the auto-user detection and changes it does. (So don't use USER within the basing image dockerfile or at least return it to root if you are done) This is to have the ability to bind ports in the system range (< 1024) within a container and to prepare the environment accordingly. This is needed as some distributions require to run certain services without any hassel, if installed through their package manager. (e.G. apache from CentOS Repositories) To execute stuff always use the available helper functions (see functions.bash).

If you need initialisation work to be done you may drop an executable script into the entrypoint.d folder of the container. The files execution order is determined by filename and thus those files are prepended with a two digit number and a dash. (e.G. 00-init-user.sh or 90-wait-for-services.sh).

Those files should not be used to spawn services but should be used to prepare the application specific environment. If you need this functionallity you should better use any other image integrating an S6 Overlay or other multi-service managers for containers.

docker-base's People

Contributors

blackskyliner avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.