Skip to content

Commit f0708c2

Browse files
author
Ace Nassri
authored
chore(node): Add Node 16 image (#181)
1 parent b0b8eea commit f0708c2

2 files changed

Lines changed: 89 additions & 0 deletions

File tree

node/16-user/Dockerfile

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Copyright 2018 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
FROM node:16-stretch
16+
17+
# Add Graphviz
18+
RUN set -ex; \
19+
apt-get update -y; \
20+
apt-get install -y \
21+
graphviz \
22+
apt-transport-https \
23+
ca-certificates \
24+
curl \
25+
gnupg-agent \
26+
lsb-release \
27+
software-properties-common \
28+
; \
29+
rm -rf /var/lib/apt/lists/*
30+
31+
# Install docker
32+
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - && \
33+
add-apt-repository \
34+
"deb [arch=amd64] https://download.docker.com/linux/debian \
35+
$(lsb_release -cs) \
36+
stable" && \
37+
apt-get update && \
38+
apt-get install -y docker-ce docker-ce-cli containerd.io
39+
40+
# Setup protoc
41+
RUN curl -L https://github.com/protocolbuffers/protobuf/releases/download/v3.10.1/protoc-3.10.1-linux-x86_64.zip > /tmp/protoc-3.10.1-linux-x86_64.zip && \
42+
cd /usr/local && unzip /tmp/protoc-3.10.1-linux-x86_64.zip && rm -f /tmp/protoc-3.10.1-linux-x86_64.zip && \
43+
chmod -R o+rX /usr/local/include/google /usr/local/bin/protoc
44+
45+
46+
# Install pyenv dependencies
47+
RUN apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
48+
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
49+
xz-utils tk-dev libffi-dev liblzma-dev python-openssl
50+
51+
USER node
52+
53+
# Install pyenv
54+
RUN git clone https://github.com/pyenv/pyenv.git ~/.pyenv
55+
RUN echo 'export PATH="/home/node/.pyenv/bin:$PATH"' >> ~/.profile && \
56+
echo 'export PATH="/home/node/.pyenv/shims:$PATH"' >> ~/.profile && \
57+
echo 'eval "$(pyenv init -)"' >> ~/.profile && \
58+
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.profile
59+
60+
ENV PATH="/home/node/.pyenv/bin:/home/node/.pyenv/shims:${PATH}"
61+
62+
# Install python
63+
RUN pyenv install 3.7.1 && \
64+
pyenv global 3.7.1 && \
65+
python3 -m pip install --upgrade pip setuptools
66+
67+
# Setup Cloud SDK
68+
WORKDIR /home/node
69+
ENV CLOUD_SDK_VERSION=261.0.0 \
70+
CLOUDSDK_PYTHON=/usr/bin/python \
71+
PATH=/home/node/google-cloud-sdk/bin:$PATH
72+
RUN set -ex; \
73+
curl -LO https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-$CLOUD_SDK_VERSION-linux-x86_64.tar.gz; \
74+
tar xzf google-cloud-sdk-$CLOUD_SDK_VERSION-linux-x86_64.tar.gz; \
75+
rm google-cloud-sdk-$CLOUD_SDK_VERSION-linux-x86_64.tar.gz
76+
RUN set -ex; \
77+
./google-cloud-sdk/install.sh; \
78+
gcloud config set core/disable_usage_reporting true; \
79+
gcloud config set component_manager/disable_update_check true; \
80+
gcloud --quiet components update; \
81+
gcloud --quiet components install beta
82+
83+
WORKDIR /

node/cloudbuild.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,11 @@ steps:
3939
dir: 'node/14-user'
4040
waitFor: ['-']
4141

42+
# Node 16
43+
- name: gcr.io/cloud-builders/docker
44+
args: ['build', '-t', 'gcr.io/cloud-devrel-kokoro-resources/node:16-user', '.']
45+
dir: 'node/16-user'
46+
waitFor: ['-']
47+
4248
images:
4349
- gcr.io/cloud-devrel-kokoro-resources/node

0 commit comments

Comments
 (0)