Code Monkey home page Code Monkey logo

r2g.docker's Introduction

r2g.docker / @oresoftware/r2g.docker

Installation

 $ npm i -g 'r2g.docker'

or just install:

 $ npm i -g 'r2g'

and r2g will install r2g.docker for you. Note that r2g docker is the same as running dkr2g exec.

Initialize

Create the files in your project that are necessary for using .r2g to the fullest:

 $ dkr2g init    # the same as `$ r2g init`

Run / Execute

 $ dkr2g exec    # the same as `$ r2g docker`

Command Line Options

By default, dkr2g uses a non-root user for the container, to use the root user, use the --root option:

dkr2g exec --root

To install local dependencies for complete local development/testing:
dkr2g exec --full --pack

If --full is used, then we install local dependencies, instead of pulling those dependencies from NPM.
This is very useful if you need to test a locally developed dependency tree.

The --pack option only applies when --full is used.
If --pack is used, then dkr2g will use npm pack against local dependencies, which converts them to
their published format.


To use different node.js / npm versions:
dkr2g exec --node-version='9.5' --npm-version='5.4'

If --node-version is used, the Docker container will use that Node version. --nodev is an alias for --node-version.
If --npm-version is used, the Docker container will use that NPM version. --npmv is an alias for --npm-version.

r2g.docker's People

Contributors

oresoftware avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

r2g.docker's Issues

if lib/package cannot be found on host fs

if lib/package cannot be found on host fs,
we should probably throw an error.

we search for the packages before starting the container so, should not be hard to do.

--allow-missing

might be a good flag to use if we want to allow packages to not be findable, etc.

push the image/container to ci/cd

perhaps the image can be pushed and tested on ci/cd platforms?

might not be worth it, tho. just rebuild the image given the Dockerfile on remote platforms.

run npm install command all at once

right now, we are running

npm install /home/node/cache/x
npm install /home/node/cache/y
...
npm install /home/node/cache/y

instead, we should simply copy the path to x, y, z to the package.json file, and then run npm install

explore/inspect Docker container fs

http://qr.ae/TUpklV

There's a few ways if you want to explore the container’s fs.

Start an interactive shell and cd/ls around: docker exec -it container bash
This requires a few things of the container though.

That there's some kind of shell and that you know the name of the shell.
That there's a ‘cd’ that or ‘ls’ command to explore with.
That the shell you enter as has access to read the directories and files.
A better way, is to docker commit the container. There will be a split second while the container is paused, but it will resume immediately after the commit.

Once it's committed, you can docker export it to a tarball and explore the file system from the host environment or another machine.

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.