Skip to content

Commit

Permalink
Added git clone in dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
haisamido committed Mar 5, 2024
1 parent 76b3956 commit 45ea2ee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
11 changes: 3 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@ FROM node:latest

LABEL maintainer="[email protected]"

RUN mkdir openmct
WORKDIR /openmct

# Mounting a volume would be better
ADD . .
RUN git clone --recurse-submodules -j2 https://github.com/nasa/openmct.git

RUN rm -rf dist
RUN rm -rf node_modules
WORKDIR /openmct

RUN npm install

EXPOSE 8080
EXPOSE 8080
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#------------------------------------------------------------------------------
# Purpose:
# Makefile that allows one to docker build, install openmct and start openmct
# Makefile that allows one to build, install openmct and start openmct in docker or podman
#
# Dependencies:
# make, docker, docker-compose
Expand All @@ -21,8 +21,11 @@ endif
export DIFF_PROGRAM :=vimdiff

export CONTAINER_BIN =docker
export CONTAINER_COMPOSE =docker-compose
export CONTAINER_TAG =openmct:latest
export CONTAINER_COMPOSE =$(CONTAINER_BIN)-compose

export CONTAINER_IMAGE =openmct
export CONTAINER_IMAGE_VERSION =latest
export CONTAINER_TAG =$(CONTAINER_IMAGE):$(CONTAINER_IMAGE_VERSION)

openmct-build: ## Build openmct on a docker image. This uses ./Dockerfile
$(CONTAINER_BIN) build -t $(CONTAINER_TAG) .
Expand All @@ -37,15 +40,15 @@ openmct-stop: ## Stop openmct on docker conainter
$(CONTAINER_COMPOSE) down -v --remove-orphans

openmct-shell: openmct-start ## Shell into running container
$(CONTAINER_COMPOSE) exec -it openmct bash
$(CONTAINER_COMPOSE) exec -it $(CONTAINER_IMAGE) bash

print-%: ## print a variable and its value, e.g. print the value of variable PROVIDER: make print-PROVIDER
@echo $* = $($*)

define print-help
$(call print-target-header,"Makefile Help")
echo
printf "%s\n" "Illustrates how to use IaC tools by example. It will be different in operations"
printf "%s\n" "Illustrates how to use openmct"
echo
$(call print-target-header,"target description")
grep -E '^([a-zA-Z_-]).+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS=":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | grep $(or $1,".*")
Expand Down

0 comments on commit 45ea2ee

Please sign in to comment.