Skip to content

Commit

Permalink
Merge pull request #15 from pluswerk/alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
Kanti authored Sep 25, 2024
2 parents ba5a088 + e0eba2d commit 71535b1
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .additional_bashrc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ fi
urls

# makes it possible to add custom prompt functions without changing the entrypoint:
test -f ~/after-bashrc_*.sh && source ~/after-bashrc_*.sh || true
test -f ~/after-bashrc_*.sh && source ~/after-bashrc_*.sh || true
30 changes: 17 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,21 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [ 16, 17, 18, 19, 20, 21, 22 ]
distroAddon: [ '', '-alpine' ]
include:
- node: 16
tags: "ghcr.io/pluswerk/node-dev:16,pluswerk/node-dev:16"
- node: 17
tags: "ghcr.io/pluswerk/node-dev:17,pluswerk/node-dev:17"
- node: 18
tags: "ghcr.io/pluswerk/node-dev:lts,ghcr.io/pluswerk/node-dev:18,pluswerk/node-dev:lts,pluswerk/node-dev:18"
- node: 19
tags: "ghcr.io/pluswerk/node-dev:19,pluswerk/node-dev:19"
- node: 20
tags: "ghcr.io/pluswerk/node-dev:20,pluswerk/node-dev:20"
#- node: 21
# tags: "ghcr.io/pluswerk/node-dev,ghcr.io/pluswerk/node-dev:current,ghcr.io/pluswerk/node-dev:21,pluswerk/node-dev,pluswerk/node-dev:current,pluswerk/node-dev:21"
distroAddon: ''
additionalTags: "ghcr.io/pluswerk/node-dev:lts,pluswerk/node-dev:lts,"
- node: 20
distroAddon: '-alpine'
additionalTags: "ghcr.io/pluswerk/node-dev:lts-alpine,pluswerk/node-dev:lts-alpine,"
- node: 22
distroAddon: ''
additionalTags: "ghcr.io/pluswerk/node-dev:latest,ghcr.io/pluswerk/node-dev:current,pluswerk/node-dev:latest,pluswerk/node-dev:current,"
- node: 22
distroAddon: '-alpine'
additionalTags: "ghcr.io/pluswerk/node-dev:latest-alpine,ghcr.io/pluswerk/node-dev:current-alpine,pluswerk/node-dev:latest-alpine,pluswerk/node-dev:current-alpine,"
steps:
-
name: Set up QEMU
Expand All @@ -53,8 +55,10 @@ jobs:
uses: docker/build-push-action@v6
with:
push: ${{ github.ref == 'refs/heads/main' }}
tags: ${{ matrix.tags }}
build-args: FROM=node:${{ matrix.node }}
tags: ${{ matrix.additionalTags }}ghcr.io/pluswerk/node-dev:${{ matrix.node }}${{ matrix.distroAddon }},pluswerk/node-dev:${{ matrix.node }}${{ matrix.distroAddon }}
build-args: |
FROM=node:${{ matrix.node }}${{ matrix.distroAddon }}
DIST_ADDON=${{ matrix.distroAddon }}
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
-
name: Image digest
Expand Down
13 changes: 11 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
ARG FROM=node:lts
FROM $FROM
ARG DIST_ADDON=-alpine
FROM $FROM AS base-alpine

# Install additional software Alpine:
RUN apk add --no-cache bash curl openssh-client-default sudo vim nano git-perl less tree bash-completion mariadb-client iputils sshpass gdb tzdata findmnt jq docker-cli file && \
echo "node ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

ENV PATH=$PATH:./node_modules/.bin

FROM $FROM AS base
RUN apt-get update && \
apt-get install -y sudo vim nano less tree bash-completion mariadb-client iputils-ping sshpass gdb jq && \
usermod -aG sudo node && \
Expand All @@ -11,6 +16,10 @@ RUN apt-get update && \
usermod -aG docker node && \
rm -rf /var/lib/apt/lists/*

FROM base${DIST_ADDON}

ENV PATH=$PATH:./node_modules/.bin

COPY bin/* /usr/local/bin/
COPY .additional_bashrc.sh .additional_bashrc_ps1.sh /home/node/
COPY .vimrc /home/node/.vimrc
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ It is derived from [pluswerk/php-dev](https://github.com/pluswerk/php-dev/) and

It comes with versions for: `current`/`21`, `20`, `19`, `lts`/`18`, `17`, `16`, `15`, `14`, `13` and `12`.

All images after `18` are also available as `alpine` versions. eg: `lts-alpine`, `current-alpine`, `20-alpine`

# example docker-compose.yml
````yml
version: '3.5'

services:
node:
image: ghcr.io/pluswerk/node-dev:lts
image: ghcr.io/pluswerk/node-dev:lts-alpine
volumes:
- ./:/app
# the docker socket is optional if no node container is needed
Expand All @@ -34,4 +36,4 @@ networks:

````

View all tags: [Githuhb Container Registry](https://github.com/pluswerk/node-dev/pkgs/container/node-dev/versions?filters%5Bversion_type%5D=tagged).
View all tags: [Github Container Registry](https://github.com/pluswerk/node-dev/pkgs/container/node-dev/versions?filters%5Bversion_type%5D=tagged).
14 changes: 7 additions & 7 deletions bin/urls
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env bash

if [ -v VIRTUAL_HOST ] ; then
echo 'Frontend URLs:'
echo $VIRTUAL_HOST | tr "," "\n" | awk '{print " https://" $0}'
else
echo 'no $VIRTUAL_HOST env set'
#!/usr/bin/env bash

if [ -v VIRTUAL_HOST ] ; then
echo 'Frontend URLs:'
echo $VIRTUAL_HOST | tr "," "\n" | awk '{print " https://" $0}'
else
echo 'no $VIRTUAL_HOST env set'
fi

0 comments on commit 71535b1

Please sign in to comment.