generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding container args as well as improving docs (#9)
* Adding container args as well as improving docs * The version cannot be used as an input * Picking a different (easier) package and not pulling image * Using a different version of slurmR for the test * Adding tag as an output * Got the names wrong for the tags * Should put the built info in the second buidl * Removing the container image for test * Renaming SHA to GH_SHA in build context * Wrong names * Re-correcting tag names * Needed to add double quotes to the image * Trying alternative approach * Adding checkout to the second job * Checking if renaming the image works * Trying with other type of labe * Adding makefile and fixing example
- Loading branch information
Showing
6 changed files
with
121 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
ARG TAG=latest | ||
ARG TAG=dependencies-latest | ||
ARG IMAGE=ghcr.io/cdcgov/cfa-actions | ||
|
||
FROM ghcr.io/cdcgov/cfa-actions:${TAG} | ||
FROM ${IMAGE}:${TAG} | ||
|
||
COPY twostep-container-build/examples/Containerfile /app/. | ||
# Notice that ARG are reset after the FROM | ||
ARG GH_SHA=default_var | ||
LABEL GH_SHA=${GH_SHA} | ||
|
||
COPY . /app/. | ||
CMD ["bash"] |
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 |
---|---|---|
@@ -1,5 +1,2 @@ | ||
FROM rocker/r-base:4.4.0 | ||
|
||
RUN install2.r epiworldR | ||
|
||
FROM python:3.12 | ||
CMD ["bash"] |
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,29 @@ | ||
ifndef TAG | ||
TAG := latest | ||
endif | ||
|
||
ifndef IMAGE | ||
IMAGE := ghcr.io/cdcgov/cfa-actions | ||
endif | ||
|
||
ifndef ENGINE | ||
ENGINE := podman | ||
endif | ||
|
||
deps: | ||
$(ENGINE) build \ | ||
--no-cache \ | ||
-t $(IMAGE):dependencies-$(TAG) -f Containerfile.dependencies | ||
|
||
build: | ||
cd ../../ && \ | ||
$(ENGINE) build \ | ||
--build-arg TAG=dependencies-$(TAG) \ | ||
--build-arg GH_SHA=example \ | ||
--build-arg IMAGE=$(IMAGE) \ | ||
--no-cache \ | ||
-t $(IMAGE):$(TAG) \ | ||
-f twostep-container-build/examples/Containerfile | ||
|
||
print-sha: | ||
$(ENGINE) inspect $(IMAGE):$(TAG) --format='{{json .Config.Labels}}' | jq . |