Skip to content

Commit

Permalink
Merge pull request #66 from boozallen/add-nvm-backstage-image
Browse files Browse the repository at this point in the history
Added an NVM Backstage image
  • Loading branch information
ltdonner-bah authored Aug 1, 2023
2 parents 4449626 + d8d07b4 commit 37b557a
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
11 changes: 11 additions & 0 deletions nvm-backstage/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright © 2023 Booz Allen Hamilton. All Rights Reserved.
# This software package is licensed under the Booz Allen Public License. The license can be found in the License file or at http://boozallen.github.io/licenses/bapl

FROM ghcr.io/boozallen/sdp-images/nvm:1.0.0

RUN dnf update -y --nodocs && \
dnf install -y --nodocs python3 make gcc gcc-c++ && \
dnf clean all && \
rm -rf /var/cache/*

CMD ["/bin/bash"]
36 changes: 36 additions & 0 deletions nvm-backstage/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
OWNER = boozallen
REPO = sdp-images
IMAGE = nvm-backstage
VERSION = 1.0.2-beta

REGISTRY = docker.pkg.github.com/$(OWNER)/$(REPO)
TAG = $(REGISTRY)/$(IMAGE):$(VERSION)

.PHONY: help Makefile
.ONESHELL: push


# Put it first so that "make" without argument is like "make help".
help: ## Show target options
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'

build: ## build container image
docker build . -t $(TAG)

push: ## builds and publishes container image
$(eval user := $(shell read -p "GitHub Username: " username; echo $$username))
$(eval pass := $(shell read -s -r -p "GitHub Token: " token; echo $$token))
@echo
@docker login $(REGISTRY) -u $(user) -p $(pass);
make build
docker tag $(TAG) $(REGISTRY)/$(IMAGE):latest
docker push $(TAG)
docker push $(REGISTRY)/$(IMAGE):latest

info:
@echo "$(TAG) -> $$(dirname $$(git ls-files --full-name Makefile))"

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
echo "Make command $@ not found"
14 changes: 14 additions & 0 deletions nvm-backstage/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-------------
Node Version Manager + Backstage dependencies
-------------

A ubi8/ubi image with node version manager (nvm), python3, make, gcc, and gcc-c++ installed. Can be used to easily specify a version of nodeJs to run.


To use, source nvm and follow `nvm usage <https://github.com/nvm-sh/nvm#usage>` instructions:

To install the lts version of nodejs, for example, run:
```
source ~/.bashrc
nvm install '*/lts'
```

0 comments on commit 37b557a

Please sign in to comment.