From 58def5fb3ab897a4caefdac3404d9c60fc57e24e Mon Sep 17 00:00:00 2001 From: eelcofolkertsma <71253997+eelcofolkertsma@users.noreply.github.com> Date: Fri, 1 Mar 2024 15:03:05 +0100 Subject: [PATCH 1/9] Update Dockerfile Add python and .gyp to support install and run of Glee project in container --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 1e20d6aa50e..6d90da1a5b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,7 @@ ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true # Since 0.14.0 release of html-template chromium is needed for pdf generation. # More custom packages for specific template should not be added to this dockerfile. Instead, we should come up with some extensibility solution. RUN apk --update add git chromium && \ + apk add --no-cache --virtual .gyp python3 make g++ && \ rm -rf /var/lib/apt/lists/* && \ rm /var/cache/apk/* From 6d5dbf27e862a3b621ac46d5616d322f75e49419 Mon Sep 17 00:00:00 2001 From: eelcofolkertsma <71253997+eelcofolkertsma@users.noreply.github.com> Date: Wed, 6 Mar 2024 16:33:28 +0100 Subject: [PATCH 2/9] composeGlee Revert Dockerfile, add composeGlee --- Dockerfile | 1 - composeGlee.yaml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 composeGlee.yaml diff --git a/Dockerfile b/Dockerfile index 6d90da1a5b1..1e20d6aa50e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,6 @@ ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true # Since 0.14.0 release of html-template chromium is needed for pdf generation. # More custom packages for specific template should not be added to this dockerfile. Instead, we should come up with some extensibility solution. RUN apk --update add git chromium && \ - apk add --no-cache --virtual .gyp python3 make g++ && \ rm -rf /var/lib/apt/lists/* && \ rm /var/cache/apk/* diff --git a/composeGlee.yaml b/composeGlee.yaml new file mode 100644 index 00000000000..264f741d433 --- /dev/null +++ b/composeGlee.yaml @@ -0,0 +1,30 @@ +version: '3' + +services: + glee: + build: + context: . + dockerfile_inline: | + FROM asyncapi/cli + USER root + RUN apk add --no-cache --virtual .gyp python3 make g++ && \ + rm -rf /var/lib/apt/lists/* && \ + asyncapi new glee && \ + cd project && \ + npm install + ENTRYPOINT + ports: + - "8080:3210" + volumes: + - ${PWD}/asyncapi.yaml:/app/asyncapi.yaml + - ${PWD}/output:/app + networks: + - default + user: root + entrypoint: [] + working_dir: /app/project + command: npm run dev + + +networks: + default: {} \ No newline at end of file From 72aa407c93ba7aaa87cfea19f76119fa57f0c067 Mon Sep 17 00:00:00 2001 From: eelcofolkertsma <71253997+eelcofolkertsma@users.noreply.github.com> Date: Thu, 7 Mar 2024 13:35:00 +0100 Subject: [PATCH 3/9] Update Dockerfile bring back python and .gyp in Dockerfile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 1e20d6aa50e..6d90da1a5b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,7 @@ ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true # Since 0.14.0 release of html-template chromium is needed for pdf generation. # More custom packages for specific template should not be added to this dockerfile. Instead, we should come up with some extensibility solution. RUN apk --update add git chromium && \ + apk add --no-cache --virtual .gyp python3 make g++ && \ rm -rf /var/lib/apt/lists/* && \ rm /var/cache/apk/* From af534fd5e50e93a91079066d808f7d46685f780e Mon Sep 17 00:00:00 2001 From: eelcofolkertsma <71253997+eelcofolkertsma@users.noreply.github.com> Date: Sat, 9 Mar 2024 17:51:40 +0000 Subject: [PATCH 4/9] Docker base image node:20-alpine --- Dockerfile | 7 ++++--- compose.yaml | 16 ++++++++++++++++ composeGlee.yaml | 30 ------------------------------ 3 files changed, 20 insertions(+), 33 deletions(-) create mode 100644 compose.yaml delete mode 100644 composeGlee.yaml diff --git a/Dockerfile b/Dockerfile index 6d90da1a5b1..14ef0334251 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ -FROM node:16-alpine +FROM node:20-alpine -ARG ASYNCAPI_CLI_VERSION=0.59.1 +# docker build -t cli:20 . # to build image +# docker compose up # to launch container with running studio, note you need to add a random asyncapi.yaml to ./output folder # Create a non-root user RUN addgroup -S myuser && adduser -S myuser -G myuser @@ -19,7 +20,7 @@ RUN apk --update add git chromium && \ rm /var/cache/apk/* # Installing latest released npm package -RUN npm install --ignore-scripts -g @asyncapi/cli@"$ASYNCAPI_CLI_VERSION" +RUN npm install --ignore-scripts -g @asyncapi/cli # Switch to the non-root user USER myuser diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 00000000000..aa21106f8d0 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,16 @@ +version: '3' + +services: + studio: + image: clitest:20 + ports: + - "8081:3210" + volumes: + - ${PWD}/output:/app + networks: + - default + user: root + command: start studio + +networks: + default: {} \ No newline at end of file diff --git a/composeGlee.yaml b/composeGlee.yaml deleted file mode 100644 index 264f741d433..00000000000 --- a/composeGlee.yaml +++ /dev/null @@ -1,30 +0,0 @@ -version: '3' - -services: - glee: - build: - context: . - dockerfile_inline: | - FROM asyncapi/cli - USER root - RUN apk add --no-cache --virtual .gyp python3 make g++ && \ - rm -rf /var/lib/apt/lists/* && \ - asyncapi new glee && \ - cd project && \ - npm install - ENTRYPOINT - ports: - - "8080:3210" - volumes: - - ${PWD}/asyncapi.yaml:/app/asyncapi.yaml - - ${PWD}/output:/app - networks: - - default - user: root - entrypoint: [] - working_dir: /app/project - command: npm run dev - - -networks: - default: {} \ No newline at end of file From 2e79ad63376699ec99b63f0443978d3bb9909ad8 Mon Sep 17 00:00:00 2001 From: eelcofolkertsma <71253997+eelcofolkertsma@users.noreply.github.com> Date: Sat, 9 Mar 2024 18:57:13 +0100 Subject: [PATCH 5/9] Update compose.yaml Used for test only, fix image reference --- compose.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compose.yaml b/compose.yaml index aa21106f8d0..323349359b1 100644 --- a/compose.yaml +++ b/compose.yaml @@ -2,7 +2,7 @@ version: '3' services: studio: - image: clitest:20 + image: cli:20 ports: - "8081:3210" volumes: @@ -13,4 +13,4 @@ services: command: start studio networks: - default: {} \ No newline at end of file + default: {} From e2119d0f8601585d309b011d5c44bb56dcf61b74 Mon Sep 17 00:00:00 2001 From: eelcofolkertsma <71253997+eelcofolkertsma@users.noreply.github.com> Date: Fri, 15 Mar 2024 09:40:43 +0000 Subject: [PATCH 6/9] Test asset filed away under test/manual folder --- Dockerfile | 2 +- compose.yaml => test/manual/docker-compose.yaml | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename compose.yaml => test/manual/docker-compose.yaml (100%) diff --git a/Dockerfile b/Dockerfile index 14ef0334251..7523de221d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM node:20-alpine # docker build -t cli:20 . # to build image -# docker compose up # to launch container with running studio, note you need to add a random asyncapi.yaml to ./output folder +# docker compose --file ./test/manual/docker-compose.yaml up # to launch container with running studio, note you need to add a random asyncapi.yaml to ./output folder # Create a non-root user RUN addgroup -S myuser && adduser -S myuser -G myuser diff --git a/compose.yaml b/test/manual/docker-compose.yaml similarity index 100% rename from compose.yaml rename to test/manual/docker-compose.yaml From da26884e2d79389dead2073ce87cef81540f25ce Mon Sep 17 00:00:00 2001 From: eelcofolkertsma <71253997+eelcofolkertsma@users.noreply.github.com> Date: Mon, 18 Mar 2024 13:19:52 +0100 Subject: [PATCH 7/9] Bring back manual version control in Dockerfile --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 7523de221d9..93e7fcf64cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,8 @@ FROM node:20-alpine +# Use below ARG in manual build of image to set version. Github workflow overrides in publication to Dockerhub +ARG ASYNCAPI_CLI_VERSION=0.0.0 + # docker build -t cli:20 . # to build image # docker compose --file ./test/manual/docker-compose.yaml up # to launch container with running studio, note you need to add a random asyncapi.yaml to ./output folder From d0b5269fc04522e9023da68570cdbabf7557d4f2 Mon Sep 17 00:00:00 2001 From: eelcofolkertsma <71253997+eelcofolkertsma@users.noreply.github.com> Date: Mon, 18 Mar 2024 13:33:15 +0100 Subject: [PATCH 8/9] Final: python and .gyp added, automated test on Docker image --- Dockerfile | 3 --- test/manual/docker-compose.yaml | 16 ---------------- 2 files changed, 19 deletions(-) delete mode 100644 test/manual/docker-compose.yaml diff --git a/Dockerfile b/Dockerfile index 93e7fcf64cb..ee58fbd262a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,6 @@ FROM node:20-alpine # Use below ARG in manual build of image to set version. Github workflow overrides in publication to Dockerhub ARG ASYNCAPI_CLI_VERSION=0.0.0 -# docker build -t cli:20 . # to build image -# docker compose --file ./test/manual/docker-compose.yaml up # to launch container with running studio, note you need to add a random asyncapi.yaml to ./output folder - # Create a non-root user RUN addgroup -S myuser && adduser -S myuser -G myuser diff --git a/test/manual/docker-compose.yaml b/test/manual/docker-compose.yaml deleted file mode 100644 index 323349359b1..00000000000 --- a/test/manual/docker-compose.yaml +++ /dev/null @@ -1,16 +0,0 @@ -version: '3' - -services: - studio: - image: cli:20 - ports: - - "8081:3210" - volumes: - - ${PWD}/output:/app - networks: - - default - user: root - command: start studio - -networks: - default: {} From 50f2b38937c2422835588040c842456df743bcfe Mon Sep 17 00:00:00 2001 From: eelcofolkertsma <71253997+eelcofolkertsma@users.noreply.github.com> Date: Wed, 27 Mar 2024 15:16:10 +0100 Subject: [PATCH 9/9] bring back explicit version selection in Dockerfile --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index ee58fbd262a..decb7a8175a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM node:20-alpine -# Use below ARG in manual build of image to set version. Github workflow overrides in publication to Dockerhub -ARG ASYNCAPI_CLI_VERSION=0.0.0 +# Set ARG to explicit value to build chosen version. Default is "latest" +ARG ASYNCAPI_CLI_VERSION= # Create a non-root user RUN addgroup -S myuser && adduser -S myuser -G myuser @@ -20,7 +20,7 @@ RUN apk --update add git chromium && \ rm /var/cache/apk/* # Installing latest released npm package -RUN npm install --ignore-scripts -g @asyncapi/cli +RUN npm install --ignore-scripts -g @asyncapi/cli@"$ASYNCAPI_CLI_VERSION" # Switch to the non-root user USER myuser