-
Notifications
You must be signed in to change notification settings - Fork 81
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
Amend Dockerfile to support alternative base images #264
Conversation
For UBI Images run: ``` docker build -t keyrock \ --build-arg BUILDER=registry.access.redhat.com/ubi8/nodejs-14 \ --build-arg DISTRO=registry.access.redhat.com/ubi8/nodejs-14-minimal \ --build-arg PACKAGE_MANAGER=yum \ --build-arg USER=1001 . --no-cache ```
CLA Assistant Lite bot All contributors have signed the CLA ✍️ |
|
||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
# hadolint ignore=DL3002 | ||
USER root | ||
|
||
ENV PYTHONUNBUFFERED=1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ENV
looks very suspicious - I guess it is an artifact from an older python-based version. Should the line be deleted?
Setting
PYTHONUNBUFFERED
to a non empty value ensures that the python output is sent straight to terminal (e.g. your container log) without being first buffered and that you can see the output of your application (e.g. django logs) in real time.
`description`,`name` and `summary` are standard UBI `LABELS`. These need to be present in the Dockerfile for the underlining `LABELS` from the base image are to be overwritten with meaningful descriptions.
- Remove unmaintained node-sass and node-sass-middleware - Add library to use sass dart and add dependency - Replace bootstrap-3-sass dependency with updated dart equivalent
I have read the CLA Document and I hereby sign the CLA |
recheckcla |
Proposed changes
This PR updates the
Dockerfile
so it is flexible enough to be able to use alternative base images should you wish. The base image still defaults to using thenode:slim
distro, but other base images can be injected using--build-arg
parameters on the command line. For example, to create a container based on Red Hat UBI (Universal Base Image) 8add
BUILDER
,DISTRO
,PACKAGE_MANAGER
andUSER
parameters as shown:To create a container based on Alpine Linux add
BUILDER
,DISTRO
,PACKAGE_MANAGER
andUSER
parameters as shown:This allows users to upgrade to their preferred Linux distro and helps to reduces Critical Vulnerabilities, and therefore makes the final product more secure.
Types of changes
What types of changes does your code introduce to the project: Put an
x
inthe boxes that apply
to not work as expected)
Checklist
Put an
x
in the boxes that apply. You can also fill these out after creatingthe PR. If you're unsure about any of them, don't hesitate to ask. We're here to
help! This is simply a reminder of what we are going to look for before merging
your code.
CONTRIBUTING
doc
CLA
works
modules
Further comments
Similar to ging/fiware-pep-proxy#134 , however Keyrock is more complex. The exisiting Node-Sass dependency is problematic - the version in
package.json
is not supported in Node:16 and furthermore rebuilding the dependency requires aCXXFLAGS
directive.With Node:16 running
npm install
results in the following error:With Node:16 running
CXXFLAGS="--std=c++14" npm install
works fine though withnode-saas
7.0.1`Similar to ging/fiware-pep-proxy#135 the
package.json
must be updated - a lot of dependencies are out of date, not justnode-sass
. This PR updates all of them exceptsequelize
which is known to be problematic.which is a significant improvement on