Skip to content

Commit b52df3c

Browse files
authored
build: fix dev docker image (#584)
1 parent 65a821e commit b52df3c

File tree

4 files changed

+8
-21
lines changed

4 files changed

+8
-21
lines changed

.github/workflows/dev-image.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,5 @@ jobs:
3434
if: github.event_name == 'pull_request'
3535
- run: make build
3636
- run: docker images
37-
- run: make ci
38-
- run: make all
3937
- run: docker-compose push
4038
if: github.ref == 'refs/heads/main' && github.event.repository.fork == false

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
npm --version
4747
git --version
4848
49-
- run: npm ci
49+
- run: npm ci --ignore-scripts
5050

5151
- name: npm audit
5252
if: startsWith(matrix.os, 'ubuntu-18.04')

Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,20 @@ RUN apt-get update && \
1717
apt-get autoremove -y && \
1818
rm -rf /var/lib/apt/lists/*
1919

20+
RUN git --version && \
21+
git config --global init.defaultBranch main && \
22+
git config --global init.defaultBranch
23+
2024
WORKDIR /node
2125
ARG NODE_VERSION
2226
RUN curl -o nodejs.deb "https://deb.nodesource.com/node_${NODE_VERSION%%.*}.x/pool/main/n/nodejs/nodejs_${NODE_VERSION}-1nodesource1_amd64.deb" && \
2327
apt-get update && \
2428
apt-get install -y --no-install-recommends ./nodejs.deb && \
29+
npm config set user 0 && \
30+
npm config set unsafe-perm true && \
2531
npm i -g npm && \
2632
curl -sL https://deb.nodesource.com/test | bash - && \
33+
npm cache clean --force && \
2734
rm -rf /var/lib/apt/lists/* && \
2835
rm -rf /node
2936

@@ -46,10 +53,4 @@ ENV RUNNER_USER="runner"
4653
ENV RUNNER_TEMP="/home/runner/work/_temp"
4754
ENV RUNNER_WORKSPACE="/home/runner/work/pages"
4855

49-
RUN echo "node version: $(node -v)" && \
50-
echo "npm version: $(npm -v)" && \
51-
git --version && \
52-
git config --global init.defaultBranch main && \
53-
git config --global init.defaultBranch
54-
5556
CMD [ "bash" ]

Makefile

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,3 @@ build:
88
.PHONY: run
99
run:
1010
docker-compose run --rm dev bash
11-
12-
.PHONY: ci
13-
ci:
14-
docker-compose run --rm -T dev npm ci --unsafe-perm=true --allow-root
15-
16-
.PHONY: test
17-
test:
18-
docker-compose run --rm -T dev npm test
19-
20-
.PHONY: all
21-
all:
22-
docker-compose run --rm -T dev npm run all

0 commit comments

Comments
 (0)