blob: 8d881875ec23d331af6073dc76e67e25b6f4315f [file] [log] [blame]
# Copyright 2020 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
ARG REGISTRY_URI=gcr.io/chromeos-partner-moblab
ARG BASE_REGISTRY_URI=us-docker.pkg.dev/chromeos-partner-moblab/base-containers
ARG LABEL=release
FROM ${REGISTRY_URI}/protoc:${LABEL} as protoc
FROM ${BASE_REGISTRY_URI}/bufbuild/buf as buf
FROM ${BASE_REGISTRY_URI}/hadolint/hadolint:latest-debian as hadolint
######################################################################
FROM ${BASE_REGISTRY_URI}/node:16-buster as base
RUN mkdir -p /usr/local/node_packages/
COPY package.json /usr/local/node_packages/
COPY package-lock.json /usr/local/node_packages/
WORKDIR /usr/local/node_packages/
# install modules and put them where we expect them to be
RUN npm install && mv /usr/local/node_packages/node_modules/* /usr/local/lib/node_modules/
ENV NODE_PATH=/usr/local/lib/node_modules/gts/node_modules:/usr/local/lib/node_modules
# workdir back to original
WORKDIR /
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] \
https://packages.cloud.google.com/apt cloud-sdk main" | \
tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg |\
apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
RUN apt-get -yq update && apt-get install --no-install-recommends -yq \
apt-transport-https \
ca-certificates \
curl \
git-core \
gnupg \
gnupg-agent \
google-cloud-sdk \
python3 \
python3-pip \
python3-setuptools \
software-properties-common \
sudo \
vim
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
# Install docker
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
RUN add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
RUN apt-get -yq update && apt-get install -yq docker-ce-cli
# Install chrome
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub |\
apt-key add -
RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ \
stable main" >> /etc/apt/sources.list.d/google.list'
RUN apt-get -yq update && apt-get install -yq google-chrome-stable
COPY requirements.txt ./
RUN python3 -m pip install --require-hashes --no-cache-dir -r requirements.txt
# Install vscode
RUN wget -O code.deb https://go.microsoft.com/fwlink/?LinkID=760868
RUN apt-get -yq update && apt install -yq ./code.deb
RUN rm code.deb
# Install meld
RUN apt-get -yq update && apt install -yq meld
# Install protoc
COPY --from=protoc /protoc/* /usr/local/bin/
# Install protobuf linter https://buf.build/
COPY --from=buf /usr/local/bin/buf /usr/local/bin
# Install Dockerfile linter https://github.com/hadolint/hadolint
COPY --from=buf /usr/local/bin/buf /usr/local/bin
# Dockerfile linter/formatter
COPY --from=hadolint /bin/hadolint /usr/local/bin
COPY get_source.sh /usr/local/bin
COPY entry.sh /usr/local/bin
RUN chmod uog+rx /usr/local/bin/get_source.sh
RUN chmod uog+rx /usr/local/bin/entry.sh