Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Debian Bookworm base image #157

Open
lyind opened this issue Nov 8, 2023 · 2 comments
Open

Update to Debian Bookworm base image #157

lyind opened this issue Nov 8, 2023 · 2 comments

Comments

@lyind
Copy link

lyind commented Nov 8, 2023

Would it make sense to:

  • update base image to Debian Bookworm (12.2)
  • install Go, Hugo from package repositories
    • this would limit control over versions too much
  • install NodeJS 18.x via package manager
  • OPTIONAL: Are g++, gcc, subversion and mercurial utilities really necessary in the huge -full image?

Background

  • The Debian 12.2 package repository contains required application packages and a few CVEs are fixed (libc and other libraries).
  • https://github.com/nodesource/distributions mentions that:

    Installation Scripts: The installation scripts setup_XX.x are no longer supported and are not needed anymore, as the installation process is straightforward for any RPM and DEB distro.

@lyind
Copy link
Author

lyind commented Nov 9, 2023

Installing Node 18.x could look as follows (based on a debian:12 or debian:12-slim image with curl and gpg installed in a previous step):

ENV NODE_MAJOR=18
RUN echo "Installing NodeJS..." && \
    mkdir -p /etc/apt/keyrings && \
    curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
    echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
    apt-get update && apt-get install -y --no-install-recommends nodejs && \
    npm install -g npm@latest && \
    npm i -g npm && \
    npm cache clean --force && \
    echo "node version: $(node -v)" && \
    echo "npm version: $(npm -v)" && \
    apt-get clean && rm -rf /var/lib/apt/lists/*

@peaceiris
Copy link
Owner

Thanks!

first step

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants