Skip to content

Commit 1ecc49a

Browse files
author
Gonzalo Diaz
committed
[BUGFIX] [Docker] running pyright (at lint / static check time) fails due pyright tries to install nodejs. Wrong image was selected an then fail due alpine restrictions. Now a python + nodejs (installed by alpine package manager) image is used at lint time.
1 parent 1c36035 commit 1ecc49a

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@ ENV WORKDIR=/app
55
WORKDIR ${WORKDIR}
66

77
###############################################################################
8-
FROM node:20.14.0-alpine3.20 AS lint
8+
FROM base AS lint
99

1010
ENV WORKDIR=/app
1111
WORKDIR ${WORKDIR}
1212

1313
COPY ./src ${WORKDIR}/src
14-
RUN apk add --update --no-cache make
15-
RUN npm install -g --ignore-scripts markdownlint-cli
14+
RUN apk add --update --no-cache make nodejs npm
1615

17-
RUN apk add --update --no-cache nodejs npm
16+
RUN npm install -g --ignore-scripts markdownlint-cli
1817
RUN npm install -g --ignore-scripts pyright
1918

2019
###############################################################################

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ clean:
110110
find . -path "*/__pycache__" -type d -print -exec rm -fr {} ';'
111111

112112
compose/build: env
113+
docker-compose --profile lint build
113114
docker-compose --profile testing build
114115

115116
compose/rebuild: env
@@ -118,10 +119,10 @@ compose/rebuild: env
118119

119120
compose/mdlint: env
120121
docker-compose --profile lint build
121-
docker-compose --profile lint run --rm algorithm-exercises-py-mdlint make mdlint
122+
docker-compose --profile lint run --rm algorithm-exercises-py-lint make mdlint
122123

123124
compose/test/static: compose/build
124-
docker-compose --profile testing run --rm algorithm-exercises-py make test/static
125+
docker-compose --profile lint run --rm algorithm-exercises-py-lint make test/static
125126

126127
compose/lint: compose/test/static compose/mdlint
127128

compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ services:
1111
- ./coverage:/app/coverage
1212
profiles: ["testing"]
1313

14-
algorithm-exercises-py-mdlint:
15-
image: algorithm-exercises-ts:mdlint
14+
algorithm-exercises-py-lint:
15+
image: algorithm-exercises-py:lint
1616
build:
1717
context: .
1818
target: lint

0 commit comments

Comments
 (0)