Skip to content

Commit e368576

Browse files
authored
Merge pull request #341 from beevelop/update
Update image
2 parents a924e98 + 192c4b3 commit e368576

File tree

5 files changed

+92
-129
lines changed

5 files changed

+92
-129
lines changed

.github/workflows/docker.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Docker Image
2+
3+
on:
4+
schedule:
5+
- cron: "0 14 * * *" # everyday at 2pm
6+
push:
7+
branches: ["**"]
8+
tags: ["v*.*.*"]
9+
10+
env:
11+
platforms: linux/amd64
12+
13+
jobs:
14+
main:
15+
runs-on: ubuntu-20.04
16+
timeout-minutes: 30
17+
steps:
18+
- name: Check out the repo
19+
uses: actions/checkout@v2
20+
- name: Set imageName based on the repository name
21+
id: step_one
22+
run: |
23+
imageName="${GITHUB_REPOSITORY/docker-/}"
24+
echo $imageName
25+
echo "imageName=$imageName" >> $GITHUB_ENV
26+
- name: Docker meta
27+
id: docker_meta
28+
uses: crazy-max/ghaction-docker-meta@v1
29+
with:
30+
images: ${{ env.imageName }}
31+
- name: Set up QEMU
32+
uses: docker/setup-qemu-action@v1
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v1
35+
- name: Login to Harbor
36+
uses: docker/login-action@v1
37+
with:
38+
username: ${{ secrets.DOCKERHUB_USERNAME }}
39+
password: ${{ secrets.DOCKERHUB_TOKEN }}
40+
- name: Buildx cache
41+
uses: actions/cache@v1
42+
with:
43+
path: ${{ github.workspace }}/cache
44+
key: ${{ runner.os }}-docker-${{ hashfiles('cache/**') }}
45+
restore-keys: |
46+
${{ runner.os }}-docker
47+
- name: Build and push
48+
id: docker_build
49+
uses: docker/build-push-action@v2
50+
with:
51+
platforms: ${{ env.platforms }}
52+
push: ${{ github.event_name != 'pull_request' }}
53+
tags: ${{ steps.docker_meta.outputs.tags }}
54+
labels: ${{ steps.docker_meta.outputs.labels }}
55+
cache-from: type=local,src=${{ github.workspace }}/cache
56+
cache-to: type=local,dest=${{ github.workspace }}/cache
57+
# temporarily disabled until https://github.com/aquasecurity/trivy-action/issues/22 is resolved
58+
# - name: Run Trivy vulnerability scanner
59+
# uses: aquasecurity/trivy-action@master
60+
# with:
61+
# image-ref: ${{ env.imageName }}:${{ steps.docker_meta.outputs.version }}
62+
# format: "template"
63+
# template: "@/contrib/sarif.tpl"
64+
# output: "trivy-results.sarif"
65+
# - name: Upload Trivy scan results to GitHub Security tab
66+
# uses: github/codeql-action/upload-sarif@v1
67+
# with:
68+
# sarif_file: "trivy-results.sarif"

.travis.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

Dockerfile

Lines changed: 13 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,15 @@
11
FROM beevelop/android
22

3-
ARG BUILD_DATE
4-
ARG BUILD_VERSION
5-
ARG VCS_REF
6-
7-
LABEL maintainer="Maik Hummel <hi@beevelop.com>" \
8-
org.label-schema.build-date=$BUILD_DATE \
9-
org.label-schema.version=$BUILD_VERSION \
10-
org.label-schema.vcs-ref=$VCS_REF \
11-
org.label-schema.schema-version="1.0" \
12-
org.label-schema.vcs-url="https://github.com/beevelop/docker-android-nodejs.git" \
13-
org.label-schema.name="beevelop/android-nodejs" \
14-
org.label-schema.vendor="Maik Hummel (beevelop)" \
15-
org.label-schema.description="Android with Node.js inside a container" \
16-
org.label-schema.url="https://beevelop.com/" \
17-
org.label-schema.license="MIT" \
18-
org.opencontainers.image.title="beevelop/android-nodejs" \
19-
org.opencontainers.image.description="Android with Node.js inside a container" \
20-
org.opencontainers.image.licenses="MIT" \
21-
org.opencontainers.image.authors="Maik Hummel (beevelop)" \
22-
org.opencontainers.image.vendor="Maik Hummel (beevelop)" \
23-
org.opencontainers.image.url="https://github.com/beevelop/docker-android-nodejs" \
24-
org.opencontainers.image.documentation="https://github.com/beevelop/docker-android-nodejs/blob/master/README.md" \
25-
org.opencontainers.image.source="https://github.com/beevelop/docker-android-nodejs.git"
26-
27-
# Source of the following lines (all rights belong to the Node.js contributors)
28-
# https://github.com/nodejs/docker-node/blob/master/12/stretch-slim/Dockerfile
29-
# LICENSE: MIT (see https://github.com/nodejs/docker-node/blob/master/LICENSE)
30-
RUN groupadd --gid 1000 node \
31-
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node
32-
33-
ENV NODE_VERSION 12.16.1
34-
35-
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
36-
&& case "${dpkgArch##*-}" in \
37-
amd64) ARCH='x64';; \
38-
ppc64el) ARCH='ppc64le';; \
39-
s390x) ARCH='s390x';; \
40-
arm64) ARCH='arm64';; \
41-
armhf) ARCH='armv7l';; \
42-
i386) ARCH='x86';; \
43-
*) echo "unsupported architecture"; exit 1 ;; \
44-
esac \
45-
&& set -ex \
46-
# libatomic1 for arm
47-
&& apt-get update && apt-get install -y ca-certificates curl wget gnupg dirmngr xz-utils libatomic1 --no-install-recommends \
48-
&& rm -rf /var/lib/apt/lists/* \
49-
&& for key in \
50-
94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
51-
FD3A5288F042B6850C66B31F09FE44734EB7990E \
52-
71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \
53-
DD8F2338BAE7501E3DD5AC78C273792F7D83545D \
54-
C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
55-
B9AE9905FFD7803F25714661B63B535A4C206CA9 \
56-
77984A986EBC2AA786BC0F66B01FBB92821C587A \
57-
8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \
58-
4ED778F539E3634C779C87C6D7062848A1AB005C \
59-
A48C2BEE680E841632CD4E44F07496B3EB3C1762 \
60-
B9E2F5981AA6E0CD28160D9FF13993A75599653C \
61-
; do \
62-
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \
63-
gpg --batch --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \
64-
gpg --batch --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \
65-
done \
66-
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
67-
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
68-
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
69-
&& grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
70-
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
71-
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
72-
&& apt-mark auto '.*' > /dev/null \
73-
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
74-
| awk '/=>/ { print $(NF-1) }' \
75-
| sort -u \
76-
| xargs -r dpkg-query --search \
77-
| cut -d: -f1 \
78-
| sort -u \
79-
| xargs -r apt-mark manual \
80-
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
81-
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
82-
# smoke tests
83-
&& node --version \
84-
&& npm --version
85-
86-
ENV YARN_VERSION 1.22.0
87-
88-
RUN set -ex \
89-
&& savedAptMark="$(apt-mark showmanual)" \
90-
&& apt-get update && apt-get install -y ca-certificates curl wget gnupg dirmngr --no-install-recommends \
91-
&& rm -rf /var/lib/apt/lists/* \
92-
&& for key in \
93-
6A010C5166006599AA17F08146C2130DFD2497F5 \
94-
; do \
95-
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \
96-
gpg --batch --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \
97-
gpg --batch --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \
98-
done \
99-
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
100-
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
101-
&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
102-
&& mkdir -p /opt \
103-
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \
104-
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \
105-
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \
106-
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
107-
&& apt-mark auto '.*' > /dev/null \
108-
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; } \
109-
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
110-
| awk '/=>/ { print $(NF-1) }' \
111-
| sort -u \
112-
| xargs -r dpkg-query --search \
113-
| cut -d: -f1 \
114-
| sort -u \
115-
| xargs -r apt-mark manual \
116-
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
117-
# smoke test
118-
&& yarn --version
3+
RUN apt-get update && apt-get install -y curl gnupg2 lsb-release && \
4+
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
5+
apt-key fingerprint 1655A0AB68576280 && \
6+
export VERSION=node_14.x && \
7+
export DISTRO="$(lsb_release -s -c)" && \
8+
echo "deb https://deb.nodesource.com/$VERSION $DISTRO main" | tee /etc/apt/sources.list.d/nodesource.list && \
9+
echo "deb-src https://deb.nodesource.com/$VERSION $DISTRO main" | tee -a /etc/apt/sources.list.d/nodesource.list && \
10+
apt-get update && apt-get install -y nodejs && \
11+
node -v && npm -v && \
12+
npm install -g yarn && \
13+
yarn -v && \
14+
apt-get clean && \
15+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016-2020 Maik Hummel (beevelop)
3+
Copyright (c) 2016-2021 Maik Hummel (beevelop)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,39 @@
1-
[![Travis](https://shields.beevelop.com/travis/beevelop/docker-nodejs.svg?style=flat-square)](https://travis-ci.org/beevelop/docker-nodejs)
21
[![Pulls](https://shields.beevelop.com/docker/pulls/beevelop/nodejs.svg?style=flat-square)](https://links.beevelop.com/d-nodejs)
32
[![Size](https://shields.beevelop.com/docker/image/size/beevelop/nodejs/latest.svg?style=flat-square)](https://links.beevelop.com/d-nodejs)
43
[![Layers](https://shields.beevelop.com/docker/image/layers/beevelop/nodejs/latest.svg?style=flat-square)](https://links.beevelop.com/d-nodejs)
54
![Badges](https://shields.beevelop.com/badge/badges-7-brightgreen.svg?style=flat-square)
65
[![Beevelop](https://links.beevelop.com/honey-badge)](https://beevelop.com)
76

8-
# Android Q (10) with Node.js `v12` and npm / yarn
7+
# Android 11 with Node.js `v14` and npm / yarn
8+
99
### based on [beevelop/android](https://github.com/beevelop/docker-android)
10-
----
10+
11+
---
12+
1113
### Pull from Docker Hub
14+
1215
```
1316
docker pull beevelop/android-nodejs:latest
1417
```
1518

1619
### Build from GitHub
20+
1721
```
1822
docker build -t beevelop/android-nodejs github.com/beevelop/docker-android-nodejs
1923
```
2024

2125
### Run image
26+
2227
```
2328
docker run -it beevelop/android-nodejs bash
2429
```
2530

2631
### Use as base image
32+
2733
```Dockerfile
2834
FROM beevelop/android-nodejs:latest
2935
```
3036

31-
----
37+
---
3238

3339
![One does not simply use latest](https://i.imgflip.com/1fgwxr.jpg)

0 commit comments

Comments
 (0)