forked from osrf/rocker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ deb_dist | |
*.pyc | ||
.coverage | ||
build | ||
rocker_venv | ||
rocker_venv | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import em | ||
import pkgutil | ||
from rocker.extensions import RockerExtension | ||
|
||
|
||
class InstallPkgs(RockerExtension): | ||
|
||
name = 'install_pkgs' | ||
|
||
@classmethod | ||
def get_name(cls): | ||
return cls.name | ||
|
||
def __init__(self): | ||
self._env_subs = None | ||
self.name = InstallPkgs.get_name() | ||
|
||
def precondition_environment(self, cli_args): | ||
pass | ||
|
||
def validate_environment(self, cli_args): | ||
pass | ||
|
||
def get_preamble(self, cli_args): | ||
return '' | ||
|
||
def get_snippet(self, cli_args): | ||
pkgs = set(cli_args['install_pkgs']) | ||
args = {'packages': list(pkgs)} | ||
|
||
snippet = pkgutil.get_data( | ||
'rocker', 'templates/{}_snippet.Dockerfile.em'.format(self.name)).decode('utf-8') | ||
|
||
return em.expand(snippet, args) | ||
|
||
@staticmethod | ||
def register_arguments(parser, defaults={}): | ||
parser.add_argument('--install-pkgs', | ||
nargs='+', | ||
help='Installs specified packages in container') | ||
|
||
# todo add argument to install common development packages by category | ||
# (e.g dev, debug, viz, sim, etc) that are not in the base image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# User specified additional packages | ||
RUN export DEBIAN_FRONTEND=noninteractive; \ | ||
apt-get update \ | ||
@# List each package specified in packages list | ||
&& apt-get install -y @[for package in packages] @package @[end for] \ | ||
# Clean | ||
&& apt-get clean |
cad50d6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it is trying to do a similar thing to: https://github.com/blooop/deps_rocker