-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add building of postam image for nodejs
- Loading branch information
Showing
3 changed files
with
183 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# syntax=docker/dockerfile:1 | ||
FROM node:21-alpine3.17 | ||
|
||
COPY postman /bin/runner | ||
RUN npm install -g newman | ||
RUN apk --no-cache add ca-certificates git curl | ||
|
||
# support npm report permissions | ||
RUN mkdir -p /.npm | ||
RUN chmod 777 /.npm | ||
RUN chmod 777 /root/ | ||
RUN chmod 777 /usr/local/lib/node_modules | ||
RUN chmod 777 /usr/local/bin | ||
|
||
WORKDIR /root/ | ||
EXPOSE 8082 | ||
|
||
USER 1001 | ||
|
||
ENTRYPOINT ["/bin/runner"] |
92 changes: 92 additions & 0 deletions
92
goreleaser_files/.goreleaser-docker-build-executor-postman-node21.yml
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,92 @@ | ||
env: | ||
# Goreleaser always uses the docker buildx builder with name "default"; see | ||
# https://github.com/goreleaser/goreleaser/pull/3199 | ||
# To use a builder other than "default", set this variable. | ||
# Necessary for, e.g., GitHub actions cache integration. | ||
- DOCKER_REPO={{ if index .Env "DOCKER_REPO" }}{{ .Env.DOCKER_REPO }}{{ else }}kubeshop{{ end }} | ||
- DOCKER_BUILDX_BUILDER={{ if index .Env "DOCKER_BUILDX_BUILDER" }}{{ .Env.DOCKER_BUILDX_BUILDER }}{{ else }}default{{ end }} | ||
# Setup to enable Docker to use, e.g., the GitHub actions cache; see | ||
# https://docs.docker.com/build/building/cache/backends/ | ||
# https://github.com/moby/buildkit#export-cache | ||
- DOCKER_BUILDX_CACHE_FROM={{ if index .Env "DOCKER_BUILDX_CACHE_FROM" }}{{ .Env.DOCKER_BUILDX_CACHE_FROM }}{{ else }}type=registry{{ end }} | ||
- DOCKER_BUILDX_CACHE_TO={{ if index .Env "DOCKER_BUILDX_CACHE_TO" }}{{ .Env.DOCKER_BUILDX_CACHE_TO }}{{ else }}type=inline{{ end }} | ||
# Build image with commit sha tag | ||
- IMAGE_TAG_SHA={{ if index .Env "IMAGE_TAG_SHA" }}{{ .Env.IMAGE_TAG_SHA }}{{ else }}{{ end }} | ||
builds: | ||
- id: "linux" | ||
main: "./contrib/executor/postman/cmd/agent" | ||
binary: "postman" | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
mod_timestamp: "{{ .CommitTimestamp }}" | ||
dockers: | ||
- dockerfile: "./contrib/executor/postman/build/agent/Dockerfile.node21" | ||
use: buildx | ||
goos: linux | ||
goarch: amd64 | ||
image_templates: | ||
- "{{ if not .Env.IMAGE_TAG_SHA }}{{ .Env.DOCKER_REPO }}/testkube-postman-executor:{{ .Version }}-node21-amd64{{ end }}" | ||
- "{{ if .Env.IMAGE_TAG_SHA }}{{ .Env.DOCKER_REPO }}/testkube-postman-executor:node21-{{ .ShortCommit }}-amd64{{ end }}" | ||
build_flag_templates: | ||
- "--platform=linux/amd64" | ||
- "--label=org.opencontainers.image.title={{ .ProjectName }}" | ||
- "--label=org.opencontainers.image.created={{ .Date}}" | ||
- "--label=org.opencontainers.image.revision={{ .FullCommit }}" | ||
- "--label=org.opencontainers.image.version={{ .Version }}" | ||
- "--builder={{ .Env.DOCKER_BUILDX_BUILDER }}" | ||
- "--cache-to={{ .Env.DOCKER_BUILDX_CACHE_TO }}" | ||
- "--cache-from={{ .Env.DOCKER_BUILDX_CACHE_FROM }}" | ||
- "--build-arg=TOKEN={{ .Env.GITHUB_TOKEN }}" | ||
- "--build-arg=ALPINE_IMAGE={{ .Env.ALPINE_IMAGE }}" | ||
- "--build-arg=BUSYBOX_IMAGE={{ .Env.BUSYBOX_IMAGE }}" | ||
|
||
- dockerfile: "./contrib/executor/postman/build/agent/Dockerfile.node21" | ||
use: buildx | ||
goos: linux | ||
goarch: arm64 | ||
image_templates: | ||
- "{{ if not .Env.IMAGE_TAG_SHA }}{{ .Env.DOCKER_REPO }}/testkube-postman-executor:{{ .Version }}-node21-arm64v8{{ end }}" | ||
- "{{ if .Env.IMAGE_TAG_SHA }}{{ .Env.DOCKER_REPO }}/testkube-postman-executor:node21-{{ .ShortCommit }}-arm64v8{{ end }}" | ||
build_flag_templates: | ||
- "--platform=linux/arm64/v8" | ||
- "--label=org.opencontainers.image.created={{ .Date }}" | ||
- "--label=org.opencontainers.image.title={{ .ProjectName }}" | ||
- "--label=org.opencontainers.image.revision={{ .FullCommit }}" | ||
- "--label=org.opencontainers.image.version={{ .Version }}" | ||
- "--builder={{ .Env.DOCKER_BUILDX_BUILDER }}" | ||
- "--cache-to={{ .Env.DOCKER_BUILDX_CACHE_TO }}" | ||
- "--cache-from={{ .Env.DOCKER_BUILDX_CACHE_FROM }}" | ||
- "--build-arg=TOKEN={{ .Env.GITHUB_TOKEN }}" | ||
- "--build-arg=ALPINE_IMAGE={{ .Env.ALPINE_IMAGE }}" | ||
- "--build-arg=BUSYBOX_IMAGE={{ .Env.BUSYBOX_IMAGE }}" | ||
|
||
docker_manifests: | ||
- name_template: "{{ if .Env.IMAGE_TAG_SHA }}{{ .Env.DOCKER_REPO }}/testkube-postman-executor:node21-{{ .ShortCommit }}{{ end }}" | ||
image_templates: | ||
- "{{ if .Env.IMAGE_TAG_SHA }}{{ .Env.DOCKER_REPO }}/testkube-postman-executor:node21-{{ .ShortCommit }}-arm64v8{{ end }}" | ||
- "{{ if .Env.IMAGE_TAG_SHA }}{{ .Env.DOCKER_REPO }}/testkube-postman-executor:node21-{{ .ShortCommit }}-amd64{{ end }}" | ||
- name_template: "{{ if not .Env.IMAGE_TAG_SHA }}{{ .Env.DOCKER_REPO }}/testkube-postman-executor:{{ .Version }}-node21{{ end }}" | ||
image_templates: | ||
- "{{ if not .Env.IMAGE_TAG_SHA }}{{ .Env.DOCKER_REPO }}/testkube-postman-executor:{{ .Version }}-node21-amd64{{ end }}" | ||
- "{{ if not .Env.IMAGE_TAG_SHA }}{{ .Env.DOCKER_REPO }}/testkube-postman-executor:{{ .Version }}-node21-arm64v8{{ end }}" | ||
- name_template: "{{ if not .Env.IMAGE_TAG_SHA }}{{ .Env.DOCKER_REPO }}/testkube-postman-executor:node21{{ end }}" | ||
image_templates: | ||
- "{{ if not .Env.IMAGE_TAG_SHA }}{{ .Env.DOCKER_REPO }}/testkube-postman-executor:{{ .Version }}-node21-amd64{{ end }}" | ||
- "{{ if not .Env.IMAGE_TAG_SHA }}{{ .Env.DOCKER_REPO }}/testkube-postman-executor:{{ .Version }}-node21-arm64v8{{ end }}" | ||
|
||
release: | ||
disable: true | ||
|
||
docker_signs: | ||
- cmd: cosign | ||
artifacts: all | ||
output: true | ||
args: | ||
- 'sign' | ||
- '${artifact}' | ||
- "--yes" |