houdini/docker/build/Dockerfile
Bradley M. Kuhn d2c6ce6d48 docker: Node/Yarn: install nodesource & yarn keys from local copy
As an additional security measure, don't use the network version of
setup_14.x.  Instead, save nodesource and yarn keys locally and do
the operations in the Dockerfile to install the keys.  Then, simply
do the apt install of the dependencies needed from both places.

Keep a copy of the setup_14.x in the data directory as well.  In
future, it might be useful to have a script that compares the
versions of that script and keys on the nodesource and yarn websites
— mainly to semi-automatically verify if upstream details have
changed.
2021-08-09 19:00:58 -07:00

36 lines
1.9 KiB
Docker

# syntax=docker/dockerfile:1
FROM bullseye
COPY script/build/debian/prebuild.sh houdini/script/build/debian/prebuild.sh
RUN houdini/script/build/debian/prebuild.sh
# Use NodeSource for installation of Node 14.x
COPY --chown=root:root docker/data/nodesource.list /etc/apt/sources.list.d/nodesource.list
COPY --chown=root:root docker/data/nodesource.gpg.key /usr/share/keyrings/nodesource.gpg.key
RUN gpg --dearmor < /usr/share/keyrings/nodesource.gpg.key > /usr/share/keyrings/nodesource.gpg
RUN rm -f /usr/share/keyrings/nodesource.gpg.key
RUN chown root.root /usr/share/keyrings/nodesource.gpg
RUN chmod 644 /usr/share/keyrings/nodesource.gpg
# Use yarnkpkg for installation of Yarn
COPY --chown=root:root docker/data/yarn.list /etc/apt/sources.list.d/yarn.list
RUN chmod 644 /etc/apt/sources.list.d/yarn.list
COPY --chown=root:root docker/data/yarnpkg.gpg.key /usr/share/keyrings/yarnpkg.gpg.key
RUN gpg --dearmor < /usr/share/keyrings/yarnpkg.gpg.key > /usr/share/keyrings/yarnpkg.gpg
RUN rm -f /usr/share/keyrings/yarnpkg.gpg.key
RUN chown root.root /usr/share/keyrings/yarnpkg.gpg
RUN chmod 644 /usr/share/keyrings/yarnpkg.gpg
# Run script to put keys in place and install
COPY --chown=houdini:houdini script/build/debian/node.sh houdini/script/build/debian/node.sh
RUN houdini/script/build/debian/node.sh
# Switch to houdini user, rest of file run in as that user after created
RUN /sbin/useradd --home-dir /houdini --create-home --shell /bin/bash houdini
USER houdini
COPY script/build/debian/node.sh houdini/script/build/debian/node.sh
RUN houdini/script/build/debian/node.sh
# COPY script/build/debian/postgres.sh houdini/script/build/debian/postgres.sh
# RUN houdini/script/build/debian/postgres.sh
# COPY gems /houdini/gems/
# WORKDIR /houdini
# COPY Gemfile /houdini/Gemfile
# COPY Gemfile.lock /houdini/Gemfile.lock
# RUN gem install bundler -v "~>1.0"
# RUN bundle install
# CMD rake -T