-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile
53 lines (44 loc) · 1.7 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM node:20-alpine as base
ARG VERSION
LABEL org.opencontainers.image.vendor="Bright Security Inc."
LABEL org.opencontainers.image.title="Repeater"
LABEL org.opencontainers.image.source="[email protected]:NeuraLegion/bright-cli.git"
LABEL org.opencontainers.image.url="https://github.com/NeuraLegion/bright-cli"
LABEL org.opencontainers.image.authors="Artem Derevnjuk <[email protected]>"
LABEL org.opencontainers.image.version="$VERSION"
# a few environment variables to make NPM installs easier
# good colors for most applications
ENV TERM xterm
# inform cli that it's running inside docker container
ENV BRIGHT_CLI_DOCKER 1
# avoid million NPM install messages
ENV NPM_CONFIG_LOGLEVEL warn
# allow installing when the main user is root
ENV NPM_CONFIG_UNSAFE_PERM true
# set CLI basepath
ENV HOME /home/node
# set as default NPM prefix a custom folder
ENV NPM_CONFIG_PREFIX $HOME/.npm
# disable npm update check
ENV NPM_CONFIG_UPDATE_NOTIFIER false
# add local bin dir to path
ENV PATH $PATH:$NPM_CONFIG_PREFIX/bin
# make folder for npm package
RUN set -eux; \
mkdir $NPM_CONFIG_PREFIX/; \
chown -R 1000:1000 $NPM_CONFIG_PREFIX/
# install @brightsec/cli from NPM
RUN set -eux; \
npm i -g -q @brightsec/cli@${VERSION}
# set the directory and file permissions to allow users in the root group to access files
# for details please refer to the doc at https://docs.openshift.com/container-platform/3.11/creating_images/guidelines.html#openshift-specific-guidelines
RUN set -eux; \
chgrp -R 0 /home/node; \
chmod -R g+rwX /home/node; \
chown -R 1000 /home/node
# change workgin dir
WORKDIR $HOME/
# set as default a non-privileged user named node.
USER 1000
ENTRYPOINT [ "bright-cli" ]
CMD ["--help"]