-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile24
82 lines (65 loc) · 2.84 KB
/
Dockerfile24
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Adapted from
FROM credocker/creubuntu:2024.0
MAINTAINER Michael Kahle <[email protected]>
ARG BUILD_YEAR=2024
ARG BUILD_MONTH=0
ARG BUILD_TAG=0.2024
#ENV DEBIAN_FRONTEND noninteractive
#ENV INITRD No
#ENV LANG en_US.UTF-8
ENV NODE_VERSION 16
LABEL Name="Node for CRE" \
CRE=$CRE_VERSION \
Year=$BUILD_YEAR \
Month=$BUILD_MONTH \
Version=$NODE_VERSION \
OS="Ubuntu:$UBUNTU_VERSION" \
Build_=$BUILD_TAG
# Install nodejs
RUN curl -sL "https://deb.nodesource.com/setup_${NODE_VERSION}.x" | bash - && apt-get install -y nodejs ## npm included in nodejs
#RUN apt-get update && apt-get install -y nodejs npm ## npm not included in nodejs
ENV NPM_CONFIG_PREFIX=/cre/node/.npm-global
ENV PATH=$PATH:/cre/node/.npm-global/bin
RUN mkdir -p /cre/node/.npm-global
RUN npm -g config set user root
# can be used to update node
RUN npm install -g n
#RUN n stable # update node
RUN npm install -g npm-install-peers
RUN npm install -g npm-add-script
RUN npm install -g keywords
RUN npm install -g json
RUN npm install -g set-version
RUN npm install -g npm-get-version
RUN npm install -g freeze-deps
## npm set init.author.email "[email protected]"
## npm set init.author.name "example_user"
## npm config set init.author.url http://iamsim.me/
RUN npm set init.version "${CRE_VERSION}.0"
RUN npm set init.license "Apache-2.0"
# npm set init.author.email "[email protected]"
# npm set init.author.name "example_user"
# npm config set init.author.url http://iamsim.me/
# https://docs.npmjs.com/creating-a-package-json-file#default-values-extracted-from-the-current-directory
COPY cre /cre
# https://sdkman.io/install
ENV SDKMAN_DIR=/cre/sdkman
#RUN curl -s "https://get.sdkman.io" | bash
RUN curl -s "https://get.sdkman.io" > /cre/sdkman-install.sh
# might patch SDKMAN_NATIVE_VERSION="*.*.*" (see i.e.16&18)
# RUN sed -e 's|SDKMAN_NATIVE_VERSION=".*"|SDKMAN_NATIVE_VERSION="0.0.23"|' -i /cre/sdkman-install.sh
# or download old version stored
## RUN cp /cre/versions/u22.04/sdkman/v5.16.0/sdkman-install.sh /cre/sdkman-install.sh
RUN chmod 777 /cre/sdkman-install.sh
RUN /bin/bash /cre/sdkman-install.sh
RUN chmod 777 "$SDKMAN_DIR/bin/sdkman-init.sh"
RUN /bin/bash -c "source $SDKMAN_DIR/bin/sdkman-init.sh; sdk version"
RUN mkdir -p /cre && touch /cre/versions.txt && \
echo "$(date +'%F %R') \t creNode \t ${NODE_VERSION}" >> /cre/versions.txt && \
echo "$(date +'%F %R') \t ldd \t $(ldd --version | grep GLIBC)" >> /cre/versions.txt && \
echo "$(date +'%F %R') \t node \t $(node --version)" >> /cre/versions.txt && \
echo "$(date +'%F %R') \t npm \t $(npm --version)" >> /cre/versions.txt && \
echo "$(date +'%F %R') \t sdk \t $(/cre/sdk.sh version | grep script | sed -e 's|script: ||')" >> /cre/versions.txt
WORKDIR "/cre/node"
ENTRYPOINT ["/cre/install-entrypoint.sh"]
CMD ["shoreman", "/cre/install-procfile"]