From 4234c21cbfaeb96960fedb428a0bf0ea2c0dcd8f Mon Sep 17 00:00:00 2001 From: Luiz Felipe Kina Date: Thu, 18 Aug 2022 13:10:43 -0400 Subject: [PATCH] debian: stx-metrics-server-sample-app: port to debian Since stx-metrics-server-sample-app doesn't inherit from the base image, the Dockerfile didn't need to be changed, but to follow the structure that was used in other apps that were migrated to debian, some directories were changed. Test Plan: PASS: Debian - Build Debian docker image and upload/apply metrics-server and metrics-server-sample-app. Verified that the app is applied and the container is created. PASS: CentOS - Same tests that were done on Debian. Story: 2009831 Task: 44511 Signed-off-by: Luiz Felipe Kina Change-Id: Ib59770209b9284e4463369234a6d833bd23232b2 --- debian_stable_docker_images.inc | 2 ++ sample-app/centos/sample-app.stable_docker_image | 4 +++- sample-app/debian/sample-app.stable_docker_image | 4 ++++ sample-app/{centos => }/docker/.dockerignore | 0 .../docker/Dockerfile => docker/Dockerfile.centos} | 0 sample-app/docker/Dockerfile.debian | 11 +++++++++++ sample-app/{centos => }/docker/src/package.json | 0 .../{centos => }/docker/src/sample-application.js | 0 8 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 debian_stable_docker_images.inc create mode 100644 sample-app/debian/sample-app.stable_docker_image rename sample-app/{centos => }/docker/.dockerignore (100%) rename sample-app/{centos/docker/Dockerfile => docker/Dockerfile.centos} (100%) create mode 100644 sample-app/docker/Dockerfile.debian rename sample-app/{centos => }/docker/src/package.json (100%) rename sample-app/{centos => }/docker/src/sample-application.js (100%) diff --git a/debian_stable_docker_images.inc b/debian_stable_docker_images.inc new file mode 100644 index 0000000..ad7b960 --- /dev/null +++ b/debian_stable_docker_images.inc @@ -0,0 +1,2 @@ +sample-app + diff --git a/sample-app/centos/sample-app.stable_docker_image b/sample-app/centos/sample-app.stable_docker_image index 8cbe97f..6f7a979 100644 --- a/sample-app/centos/sample-app.stable_docker_image +++ b/sample-app/centos/sample-app.stable_docker_image @@ -1,2 +1,4 @@ BUILDER=docker -LABEL=stx-metrics-server-sample-app \ No newline at end of file +LABEL=stx-metrics-server-sample-app +DOCKER_CONTEXT=../docker/ +DOCKER_FILE=../docker/Dockerfile.centos diff --git a/sample-app/debian/sample-app.stable_docker_image b/sample-app/debian/sample-app.stable_docker_image new file mode 100644 index 0000000..e24072b --- /dev/null +++ b/sample-app/debian/sample-app.stable_docker_image @@ -0,0 +1,4 @@ +BUILDER=docker +LABEL=stx-metrics-server-sample-app +DOCKER_CONTEXT=../docker/ +DOCKER_FILE=../docker/Dockerfile.debian diff --git a/sample-app/centos/docker/.dockerignore b/sample-app/docker/.dockerignore similarity index 100% rename from sample-app/centos/docker/.dockerignore rename to sample-app/docker/.dockerignore diff --git a/sample-app/centos/docker/Dockerfile b/sample-app/docker/Dockerfile.centos similarity index 100% rename from sample-app/centos/docker/Dockerfile rename to sample-app/docker/Dockerfile.centos diff --git a/sample-app/docker/Dockerfile.debian b/sample-app/docker/Dockerfile.debian new file mode 100644 index 0000000..cd4224b --- /dev/null +++ b/sample-app/docker/Dockerfile.debian @@ -0,0 +1,11 @@ +FROM node:14.15.5-alpine3.13 + +WORKDIR /usr/src/app + +COPY src/package*.json ./ + +RUN npm install + +COPY src/ . + +CMD [ "node", "sample-application.js" ] \ No newline at end of file diff --git a/sample-app/centos/docker/src/package.json b/sample-app/docker/src/package.json similarity index 100% rename from sample-app/centos/docker/src/package.json rename to sample-app/docker/src/package.json diff --git a/sample-app/centos/docker/src/sample-application.js b/sample-app/docker/src/sample-application.js similarity index 100% rename from sample-app/centos/docker/src/sample-application.js rename to sample-app/docker/src/sample-application.js