Coder Social home page Coder Social logo

oxedions / image-common Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nimbix/image-common

0.0 1.0 0.0 3.06 MB

Common packages and configuration files for Nimbix base images

HTML 5.02% Shell 3.28% Python 15.05% Makefile 0.19% CSS 1.85% JavaScript 73.71% Perl 0.04% Roff 0.60% C 0.27%

image-common's Introduction

image-common

Common packages and configuration files for Nimbix base images. This will retrofit existing Docker images for better execution on JARVICE.

If you have an image derived from a non-Nimbix base, and you want to improve its execution on JARVICE, there is now a simple way to do this in your Dockerfile without having to change your FROM line. Currently, we only support CentOS and Ubuntu with this trick.

Verified distributions:

  • CentOS 7 (x86_64, ppc64le)
  • Ubuntu 16.04 Xenial (amd64, ppc64le)
  • Ubuntu 18.04 Bionic (amd64, ppc64le)

Just add this to the end of your Dockerfile:

Ubuntu

RUN apt-get -y update && \
    DEBIAN_FRONTEND=noninteractive apt-get -y install curl && \
    curl -H 'Cache-Control: no-cache' \
        https://raw.githubusercontent.com/nimbix/image-common/master/install-nimbix.sh \
        | bash

# Expose port 22 for local JARVICE emulation in docker
EXPOSE 22

Ubuntu (with Nimbix desktop)

RUN apt-get -y update && \
    DEBIAN_FRONTEND=noninteractive apt-get -y install curl && \
    curl -H 'Cache-Control: no-cache' \
        https://raw.githubusercontent.com/nimbix/image-common/master/install-nimbix.sh \
        | bash -s -- --setup-nimbix-desktop

# Expose port 22 for local JARVICE emulation in docker
EXPOSE 22

# for standalone use
EXPOSE 5901
EXPOSE 443

CentOS

RUN curl -H 'Cache-Control: no-cache' \
        https://raw.githubusercontent.com/nimbix/image-common/master/install-nimbix.sh \
        | bash

# Expose port 22 for local JARVICE emulation in docker
EXPOSE 22

CentOS (with Nimbix desktop)

RUN curl -H 'Cache-Control: no-cache' \
        https://raw.githubusercontent.com/nimbix/image-common/master/install-nimbix.sh \
        | bash -s -- --setup-nimbix-desktop

# Expose port 22 for local JARVICE emulation in docker
EXPOSE 22

# for standalone use
EXPOSE 5901
EXPOSE 443

This does several things:

  1. installs recommended packages for running on JARVICE
  2. makes sure SSH actually starts (important when using nvidia/ base images for example)
  3. sets up the nimbix user, and gives it password-less sudo access
  4. configures JARVICE "emulation" for local testing (see our PushToCompute tutorial for more on that)
  5. preserves the Docker environment variables and makes sure they are set when you run in JARVICE as well

Docker build caching of install-nimbix.sh layer

While developing an app and subsequently running multiple docker builds, it can be easy to be thrown off by the caching of successfully built layers. Docker will not be able to pick up changes to install-nimbix.sh in the image-common git repository. Thus, if the layer's RUN instruction has not changed, it may not be rebuilt if it has previously executed successfully.

Using an easily updatable ENV instruction is a simple way to invalidate a layer and force it to be rebuilt. Simply add an instruction like this before your RUN of install-nimbix.sh or any other layers you wish to easily invalidate by changing the SERIAL_NUMBER:

# Update SERIAL_NUMBER to force rebuild of subsequent layers
#   (i.e. don't use cached layers)
ENV SERIAL_NUMBER 20171009.1713

Allow more control by using --build-arg with a local docker build command line:

# Update SERIAL_NUMBER to force rebuild of subsequent layers
#   (i.e. don't use cached layers)
ARG SERIAL_NUMBER
ENV SERIAL_NUMBER ${SERIAL_NUMBER:-20171009.1713}

image-common's People

Contributors

johnathanhegge avatar kenhill avatar nimbixler avatar oxedions avatar paulbsch 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.