Skip to content

Commit ce43c38

Browse files
committed
add no cache
1 parent 2cdcba2 commit ce43c38

File tree

14 files changed

+27
-26
lines changed

14 files changed

+27
-26
lines changed

.github/workflows/build_all_images.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ name: build_all_images
88
tag_latest:
99
required: true
1010
type: boolean
11+
NO_CACHE:
12+
required: true
13+
type: boolean
1114
env:
1215
BRANCH_NAME: '${{ github.event.pull_request.head.ref }}'
1316
jobs:
@@ -32,6 +35,7 @@ jobs:
3235
docker_tag: ${{ inputs.docker_tag }}
3336
container_name: base
3437
base_folder: "."
38+
NO_CACHE: ${{ inputs.NO_CACHE }}
3539
package_language_docker_images:
3640
needs:
3741
- package_base_docker_image
@@ -46,6 +50,7 @@ jobs:
4650
docker_tag: ${{ inputs.docker_tag }}
4751
container_name: ${{ matrix.container_name }}
4852
base_folder: "languages"
53+
NO_CACHE: ${{ inputs.NO_CACHE }}
4954
package_project_docker_images:
5055
needs:
5156
- package_language_docker_images
@@ -61,3 +66,4 @@ jobs:
6166
docker_tag: ${{ inputs.docker_tag }}
6267
container_name: ${{ matrix.container_name }}
6368
base_folder: "projects"
69+
NO_CACHE: ${{ inputs.NO_CACHE }}

.github/workflows/build_multi_arch_image.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ name: Build and push docker image
1414
base_folder:
1515
required: true
1616
type: string
17+
NO_CACHE:
18+
required: true
19+
type: boolean
1720

1821
jobs:
1922
build_and_push_image:
@@ -87,6 +90,7 @@ jobs:
8790
BASE_VERSION_TAG: ${{ inputs.docker_tag}}
8891
IMAGE_TAG: "${{ inputs.docker_tag }}-${{ matrix.arch }}"
8992
BASE_FOLDER: "${{ inputs.base_folder }}"
93+
NO_CACHE: '${{ inputs.NO_CACHE }}'
9094
- name: Check docker vulnerabilities - json output
9195
uses: aquasecurity/trivy-action@c1824fd6edce30d7ab345a9989de00bbd46ef284
9296
with:

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ jobs:
4545
with:
4646
docker_tag: '${{ needs.tag_release.outputs.version_tag }}'
4747
tag_latest: false
48+
NO_CACHE: false

.github/workflows/pull_request.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,4 @@ jobs:
9292
with:
9393
docker_tag: 'pr-${{ needs.get_issue_number.outputs.issue_number }}-${{ needs.get_commit_id.outputs.sha_short }}'
9494
tag_latest: false
95+
NO_CACHE: false

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ jobs:
4646
with:
4747
docker_tag: '${{ needs.tag_release.outputs.version_tag }}'
4848
tag_latest: true
49+
NO_CACHE: true

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ ifneq ($(strip $(PLATFORM)),)
44
PLATFORM_FLAG=--platform $(PLATFORM)
55
endif
66

7+
ifeq ($(strip $(NO_CACHE)),true)
8+
NO_CACHE_FLAG=--no-cache
9+
endif
10+
711
guard-%:
812
@ if [ "${${*}}" = "" ]; then \
913
echo "Environment variable $* not set"; \
@@ -24,6 +28,7 @@ install-hooks: install-python
2428
build-image: guard-CONTAINER_NAME guard-BASE_VERSION_TAG guard-BASE_FOLDER guard-IMAGE_TAG
2529
npx devcontainer build \
2630
--workspace-folder ./src/$${BASE_FOLDER}/$${CONTAINER_NAME} \
31+
$(NO_CACHE_FLAG) \
2732
--push false \
2833
--cache-from "${CONTAINER_PREFIX}$${CONTAINER_NAME}:latest" \
2934
--image-name "${CONTAINER_PREFIX}$${CONTAINER_NAME}:$${IMAGE_TAG}"

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ CONTAINER_NAME=base \
153153
```
154154
Language images
155155
```
156-
CONTAINER_NAME=node_24_python_3_12 \
156+
CONTAINER_NAME=node_24_python_3_14 \
157157
BASE_VERSION_TAG=local-build \
158158
BASE_FOLDER=languages \
159159
IMAGE_TAG=local-build \
@@ -214,7 +214,10 @@ CONTAINER_NAME=fhir_facade_api \
214214
```
215215

216216
## Using local or pull request images
217-
You can use local or pull request images by changing IMAGE_VERSION in devcontainer.json
217+
You can use local or pull request images by changing IMAGE_VERSION in devcontainer.json.
218+
For an image built locally, you should put the IMAGE_VERSION=local-build.
219+
For an image built from a pull request, you should put the IMAGE_VERSION=<tag of image as show in pull request job>.
220+
You can only use images built from a pull request for testing changes in github actions.
218221

219222
## Generating a .trivyignore file
220223
You can generate a .trivyignore file for known vulnerabilities by either downloading the json scan output generated by the build, or by generating it locally using the scanning images commands above with a make target of scan-image-json

src/base/.devcontainer/devcontainer.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
"IMAGE_TAG": "${localEnv:IMAGE_TAG}"
1313
}
1414
},
15-
"runArgs": [
16-
"--network=host"
17-
],
18-
"remoteEnv": { "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}" },
1915
"features": {
2016
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
2117
"version": "latest",

src/base/.devcontainer/scripts/vscode_install.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@ asdf plugin add yq https://github.com/sudermanjr/asdf-yq.git
2424
# install base asdf versions of common tools
2525
cd /home/vscode
2626
asdf install
27+
28+
# create .ssh/known_hosts to prevent devcontainer copying from localhost
29+
mkdir -p /home/vscode/.ssh
30+
echo "" > /home/vscode/.ssh/known_hosts

src/languages/node_24_python_3_12/.devcontainer/devcontainer.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
},
1414
"context": "."
1515
},
16-
"runArgs": [
17-
"--network=host"
18-
],
19-
"remoteEnv": { "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}" },
2016
"features": {}
2117
}
2218

0 commit comments

Comments
 (0)