fix: use python3 or python2 for alpine
In alpine3.12, they removed the python package in favor of either python2 or python3. https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.12.0#python2_no_longer_provides_python_and_python-devel However, nodejs 12, 10 require python2 for building from source. I added a change in update.sh that swaps out python3 for python2 in those older versions for alpine Dockerfiles. Refs #1330
This commit is contained in:
parent
3a5c226f51
commit
3d290f8d6d
|
@ -33,7 +33,7 @@ RUN addgroup -g 1000 node \
|
|||
libgcc \
|
||||
linux-headers \
|
||||
make \
|
||||
python \
|
||||
python2 \
|
||||
# gpg keys listed at https://github.com/nodejs/node#release-keys
|
||||
&& for key in \
|
||||
4ED778F539E3634C779C87C6D7062848A1AB005C \
|
||||
|
|
|
@ -33,7 +33,7 @@ RUN addgroup -g 1000 node \
|
|||
libgcc \
|
||||
linux-headers \
|
||||
make \
|
||||
python \
|
||||
python2 \
|
||||
# gpg keys listed at https://github.com/nodejs/node#release-keys
|
||||
&& for key in \
|
||||
4ED778F539E3634C779C87C6D7062848A1AB005C \
|
||||
|
|
|
@ -33,7 +33,7 @@ RUN addgroup -g 1000 node \
|
|||
libgcc \
|
||||
linux-headers \
|
||||
make \
|
||||
python \
|
||||
python2 \
|
||||
# gpg keys listed at https://github.com/nodejs/node#release-keys
|
||||
&& for key in \
|
||||
4ED778F539E3634C779C87C6D7062848A1AB005C \
|
||||
|
|
|
@ -33,7 +33,7 @@ RUN addgroup -g 1000 node \
|
|||
libgcc \
|
||||
linux-headers \
|
||||
make \
|
||||
python \
|
||||
python2 \
|
||||
# gpg keys listed at https://github.com/nodejs/node#release-keys
|
||||
&& for key in \
|
||||
4ED778F539E3634C779C87C6D7062848A1AB005C \
|
||||
|
|
|
@ -33,7 +33,7 @@ RUN addgroup -g 1000 node \
|
|||
libgcc \
|
||||
linux-headers \
|
||||
make \
|
||||
python \
|
||||
python2 \
|
||||
# gpg keys listed at https://github.com/nodejs/node#release-keys
|
||||
&& for key in \
|
||||
4ED778F539E3634C779C87C6D7062848A1AB005C \
|
||||
|
|
|
@ -33,7 +33,7 @@ RUN addgroup -g 1000 node \
|
|||
libgcc \
|
||||
linux-headers \
|
||||
make \
|
||||
python \
|
||||
python2 \
|
||||
# gpg keys listed at https://github.com/nodejs/node#release-keys
|
||||
&& for key in \
|
||||
4ED778F539E3634C779C87C6D7062848A1AB005C \
|
||||
|
|
|
@ -33,7 +33,7 @@ RUN addgroup -g 1000 node \
|
|||
libgcc \
|
||||
linux-headers \
|
||||
make \
|
||||
python \
|
||||
python2 \
|
||||
# gpg keys listed at https://github.com/nodejs/node#release-keys
|
||||
&& for key in \
|
||||
4ED778F539E3634C779C87C6D7062848A1AB005C \
|
||||
|
|
|
@ -33,7 +33,7 @@ RUN addgroup -g 1000 node \
|
|||
libgcc \
|
||||
linux-headers \
|
||||
make \
|
||||
python \
|
||||
python3 \
|
||||
# gpg keys listed at https://github.com/nodejs/node#release-keys
|
||||
&& for key in \
|
||||
4ED778F539E3634C779C87C6D7062848A1AB005C \
|
||||
|
|
|
@ -33,7 +33,7 @@ RUN addgroup -g 1000 node \
|
|||
libgcc \
|
||||
linux-headers \
|
||||
make \
|
||||
python \
|
||||
python3 \
|
||||
# gpg keys listed at https://github.com/nodejs/node#release-keys
|
||||
&& for key in \
|
||||
4ED778F539E3634C779C87C6D7062848A1AB005C \
|
||||
|
|
|
@ -33,7 +33,7 @@ RUN addgroup -g 1000 node \
|
|||
libgcc \
|
||||
linux-headers \
|
||||
make \
|
||||
python \
|
||||
python3 \
|
||||
# gpg keys listed at https://github.com/nodejs/node#release-keys
|
||||
&& for key in \
|
||||
4ED778F539E3634C779C87C6D7062848A1AB005C \
|
||||
|
|
|
@ -33,7 +33,7 @@ RUN addgroup -g 1000 node \
|
|||
libgcc \
|
||||
linux-headers \
|
||||
make \
|
||||
python \
|
||||
${PYTHON_VERSION} \
|
||||
# gpg keys listed at https://github.com/nodejs/node#release-keys
|
||||
&& for key in \
|
||||
"${NODE_KEYS[@]}"
|
||||
|
|
|
@ -167,6 +167,15 @@ function update_node_version() {
|
|||
)\""
|
||||
sed -Ei -e "s/(alpine:)0.0/\\1${alpine_version}/" "${dockerfile}-tmp"
|
||||
sed -Ei -e "s/CHECKSUM=CHECKSUM_x64/CHECKSUM=${checksum}/" "${dockerfile}-tmp"
|
||||
|
||||
# Use python2 for nodejs < 14 on alpine
|
||||
if [ "$version" -lt 14 ]; then
|
||||
pythonVersion="python2"
|
||||
else
|
||||
pythonVersion="python3"
|
||||
fi
|
||||
|
||||
sed -Ei -e 's/\$\{PYTHON_VERSION\}/'"${pythonVersion}"'/' "${dockerfile}-tmp"
|
||||
elif is_debian "${variant}"; then
|
||||
sed -Ei -e "s/(buildpack-deps:)name/\\1${variant}/" "${dockerfile}-tmp"
|
||||
elif is_debian_slim "${variant}"; then
|
||||
|
|
Loading…
Reference in New Issue