Skip to content

Commit ff7fa67

Browse files
Copilotjbtronics
andauthored
Install Yarn via npm instead of Debian packages in Dockerfiles (#1207)
* Initial plan * Change yarn installation from Debian packages to npm in both Dockerfiles Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com>
1 parent af61772 commit ff7fa67

File tree

2 files changed

+10
-22
lines changed

2 files changed

+10
-22
lines changed

Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,11 @@ RUN apt-get update && apt-get -y install \
4646
&& rm -rvf /var/www/html/*
4747

4848
# Install node and yarn
49-
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
50-
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
51-
curl -sL https://deb.nodesource.com/setup_22.x | bash - && \
49+
RUN curl -sL https://deb.nodesource.com/setup_22.x | bash - && \
5250
apt-get update && apt-get install -y \
5351
nodejs \
54-
yarn \
55-
&& apt-get -y autoremove && apt-get clean autoclean && rm -rf /var/lib/apt/lists/*
52+
&& apt-get -y autoremove && apt-get clean autoclean && rm -rf /var/lib/apt/lists/* && \
53+
npm install -g yarn
5654

5755
# Install composer
5856
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

Dockerfile-frankenphp

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,21 @@ RUN apt-get update && apt-get -y install \
1414
&& apt-get -y autoremove && apt-get clean autoclean && rm -rf /var/lib/apt/lists/*;
1515

1616
RUN set -eux; \
17-
# Prepare keyrings directory
18-
mkdir -p /etc/apt/keyrings; \
19-
\
20-
# Import Yarn GPG key
21-
curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg \
22-
| tee /etc/apt/keyrings/yarn.gpg >/dev/null; \
23-
chmod 644 /etc/apt/keyrings/yarn.gpg; \
24-
\
25-
# Add Yarn repo with signed-by
26-
echo "deb [signed-by=/etc/apt/keyrings/yarn.gpg] https://dl.yarnpkg.com/debian stable main" \
27-
| tee /etc/apt/sources.list.d/yarn.list; \
28-
\
29-
# Run NodeSource setup script (unchanged)
17+
# Run NodeSource setup script
3018
curl -sL https://deb.nodesource.com/setup_22.x | bash -; \
3119
\
32-
# Install Node.js + Yarn
20+
# Install Node.js
3321
apt-get update; \
3422
apt-get install -y --no-install-recommends \
35-
nodejs \
36-
yarn; \
23+
nodejs; \
3724
\
3825
# Cleanup
3926
apt-get -y autoremove; \
4027
apt-get clean autoclean; \
41-
rm -rf /var/lib/apt/lists/*
28+
rm -rf /var/lib/apt/lists/*; \
29+
\
30+
# Install Yarn via npm
31+
npm install -g yarn
4232

4333

4434
# Install PHP

0 commit comments

Comments
 (0)