From b6102b5872836259ebc7a392b9358d4d62448ebf Mon Sep 17 00:00:00 2001 From: Carlos Gomes Date: Fri, 12 Nov 2021 00:01:00 +0100 Subject: [PATCH] Install Node from download instead of apk --- Dockerfile | 24 +++++++++++++++++------- Makefile | 14 ++++++++++++++ README.md | 2 +- zshrc | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 64 insertions(+), 8 deletions(-) create mode 100644 Makefile create mode 100644 zshrc diff --git a/Dockerfile b/Dockerfile index 7fa5aef..8d3db8b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,6 @@ FROM $FROM_IMAGE LABEL maintainer="Carlos A. Gomes " -ARG DEPLOYER_VERSION="v6.8.0" RUN apk add --no-cache \ util-linux \ @@ -16,13 +15,8 @@ RUN apk add --no-cache \ rsync \ git \ mysql-client \ - nodejs \ - npm \ - yarn \ composer \ - make \ -&& curl -L https://deployer.org/releases/${DEPLOYER_VERSION}/deployer.phar --output /usr/local/bin/dep \ -&& chmod +x /usr/local/bin/dep + make ARG PECL_EXT="mcrypt-1.0.4" ARG PHP_EXT="mysqli pspell zip" @@ -44,3 +38,19 @@ if [ ! -z "$PECL_EXT" ]; then \ fi; \ docker-php-ext-install -j "$(nproc)" $PHP_EXT; \ apk del .build-deps + + +ARG DEPLOYER_VERSION="v6.8.0" +RUN curl -L https://deployer.org/releases/${DEPLOYER_VERSION}/deployer.phar --output /usr/local/bin/dep \ + && chmod +x /usr/local/bin/dep + + +# Install node, npm and yarn +ARG NODE_VERSION="v16.13.0" +RUN curl -O https://unofficial-builds.nodejs.org/download/release/${NODE_VERSION}/node-${NODE_VERSION}-linux-x64-musl.tar.xz \ + && tar xJf node-v*.xz -C /usr --strip-components=1 --no-same-owner \ + && rm node-v*.xz \ + && npm i -g yarn + + +COPY zshrc /root/.zshrc diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4432280 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ + +build_8: + docker build . --rm \ + -t carlosalgms/composer-and-node-ci:latest \ + -t carlosalgms/composer-and-node-ci:php8 + +build_71: + docker build . --rm \ + -t carlosalgms/composer-and-node-ci:php7.1 \ + --build-arg=FROM_IMAGE="php:7.1-cli-alpine" \ + --build-arg=DEPLOYER_VERSION="v6.6.0" \ + --build-arg=PECL_EXT="" \ + --build-arg=ENABLE_EXT="" \ + --build-arg=PHP_EXT="mysqli pspell zip mcrypt" diff --git a/README.md b/README.md index dbd9606..e19cd01 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ To deploy and transfer files, [Deployer](https://deployer.org), SSH, and RSync a ## This image includes: -* [NodeJS 14.x and NPM](https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions) +* [NodeJS 16.x and NPM](https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions) * [yarn - latest](https://classic.yarnpkg.com/en/docs/install/#debian-stable) * PHP 8-cli, 7.1-cli * [Composer - latest](https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md) diff --git a/zshrc b/zshrc new file mode 100644 index 0000000..e28523d --- /dev/null +++ b/zshrc @@ -0,0 +1,32 @@ +PROMPT=$'\n'"%B%F{green}%n%f %F{blue}%~%f%b"$'\n'"λ " + +export LS_OPTIONS='--color=auto -F --group-directories-first' +alias ls='ls $LS_OPTIONS' +alias ll='ls $LS_OPTIONS -l' +alias l='ls $LS_OPTIONS -lA' + +extract () { + if [ -f $1 ] ; then + filename=$(basename -- "$1") + filename="${filename%.*}" + target="${2-"./$filename"}" + + case $1 in + *.tar.bz2) tar xvjf $1 -C "$target" ;; + *.tar.gz) tar xvzf $1 -C "$target" ;; + *.tar.xz) tar xJf $1 -C "$target" ;; + *.bz2) bunzip2 $1 ;; + *.rar) rar x $1 "$target" ;; + *.gz) gunzip $1 ;; + *.tar) tar xvf $1 -C "$target" ;; + *.tbz2) tar xvjf $1 -C "$target" ;; + *.tgz) tar xvzf $1 -C "$target" ;; + *.zip) unzip $1 -d "$target" ;; + *.Z) uncompress $1 ;; + *.7z) 7z x $1 -o"$target" ;; + *) echo "don't know how to extract '$1'..." ;; + esac + else + echo "'$1' is not a valid file!" + fi +}