Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move sigularity to a container for portability
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
- Loading branch information
Showing
10 changed files
with
108 additions
and
35 deletions.
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
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
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 @@ | ||
cache |
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,17 @@ | ||
.PHONY: all | ||
all: | ||
cd singularity && make | ||
|
||
.PHONY: save-cache | ||
save-cache: | ||
cd singularity && make save-cache | ||
|
||
.PHONY: load-cache | ||
load-cache: | ||
cd singularity && make load-cache | ||
|
||
.PHONY: fingerprint | ||
fingerprint: | ||
@# for all tools, generate | ||
@rm -f cache.fingerprint | ||
@cat */cache.fingerprint | sort | md5sum | tee cache.fingerprint |
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 @@ | ||
Makefile |
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,4 @@ | ||
FROM ubuntu:20.04 | ||
RUN apt-get update && apt-get install curl -y && \ | ||
curl -sLO https://github.com/sylabs/singularity/releases/download/v3.10.0/singularity-ce_3.10.0-focal_amd64.deb && \ | ||
apt-get install -f ./singularity-ce_3.10.0-focal_amd64.deb -y |
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,28 @@ | ||
CACHE_DIR = ../cache | ||
CACHE_FILE_NAME = singularity-image.tar | ||
CACHE_FILE = $(CACHE_DIR)/$(CACHE_FILE_NAME) | ||
TAG = localhost/singularity:dev | ||
|
||
.PHONY: all | ||
all: | ||
@docker inspect $(TAG) > /dev/null && echo "$(TAG) already exists" || (make build && make save-cache) | ||
|
||
.PHONY: build | ||
build: | ||
docker build -t $(TAG) . | ||
|
||
.PHONY: save-cache | ||
save-cache: $(CACHE_DIR) | ||
docker image save $(TAG) -o $(CACHE_FILE) | ||
|
||
.PHONY: load-cache | ||
load-cache: | ||
docker image load -i $(CACHE_FILE) | ||
|
||
$(CACHE_DIR): | ||
mkdir -p $(CACHE_DIR) | ||
|
||
# note: this is used by CI to determine if the tool image should be rebuilt/refreshed | ||
.PHONY: fingerprint | ||
fingerprint: | ||
find Dockerfile -type f -exec md5sum {} + | sort | md5sum | tee cache.fingerprint |