55
66FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:16
77
8- # The javascript-node image includes a non-root node user with sudo access. Use
9- # the "remoteUser" property in devcontainer.json to use it. On Linux, the container
8+ # The javascript-node image includes a non-root node user with sudo access. Use
9+ # the "remoteUser" property in devcontainer.json to use it. On Linux, the container
1010# user's GID/UIDs will be updated to match your local UID/GID when using the image
1111# or dockerFile property. Update USER_UID/USER_GID below if you are using the
1212# dockerComposeFile property or want the image itself to start with different ID
1313# values. See https://aka.ms/vscode-remote/containers/non-root-user for details.
1414ARG USERNAME=node
1515ARG USER_UID=1000
1616ARG USER_GID=$USER_UID
17- # ARG EXTRA_NODE_VERSION=14
1817ENV KUBECONFIG="/usr/local/share/kube-devcontainer/kubeconfig.yml"
1918ENV XSCLI="/workspaces/vsc-sap-hana-mta-dev-env-node16x/XS_CLIENT00P_134-70001320"
2019ENV PATH=$PATH:${XSCLI}/bin
2120ENV npm config set registry https://registry.npmjs.org/
22- WORKDIR /usr/app
21+
22+ WORKDIR /workspaces/vsc-sap-hana-mta-dev-env-node16x
2323COPY ./ ./
24+ # COPY additional-features .
25+
2426# # # Prepare for apt-based install of Cloud Foundry CLI by adding Cloud Foundry Foundation public key & package repository
2527# # # (see https://docs.cloudfoundry.org/cf-cli/install-go-cli.html#pkg-linux).
2628RUN wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add - ; \
2729 echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list \
2830 && sudo apt-get -y update \
29- # To install cf CLI v6, run
30- && sudo apt-get -y install cf-cli
31-
32- # # keytar - Node module to manage system keychain (VSCode keytar)
33- RUN sudo apt-get update -y && sudo apt-get -y install libsecret-1-dev
34-
35- # # Alter node user as needed, install tslint, typescript. eslint is installed by javascript image
36- RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then \
31+ # To install cf CLI v6, run
32+ && sudo apt-get -y install cf-cli \
33+ # Keytar - Node module to manage system keychain (VSCode keytar)
34+ && sudo apt-get update -y \
35+ && sudo apt-get -y install libsecret-1-dev \
36+ # Alter node user as needed, install tslint, typescript. eslint is installed by javascript image
37+ && if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then \
3738 groupmod --gid $USER_GID $USERNAME \
3839 && usermod --uid $USER_UID --gid $USER_GID $USERNAME \
3940 && chown -R $USER_UID:$USER_GID /home/$USERNAME; \
4041 fi \
41- #
42- # Install tslint, typescript. eslint is installed by javascript image
42+ # Install tslint, typescript. eslint is installed by javascript image
4343 && sudo -u ${USERNAME} npm install -g typescript \
44- # https://help.sap.com/viewer/17d50220bcd848aa854c9c182d65b699/Latest/en-US/17efa217f7f34a9eba53d7b209ca4280.html#loio5701672c35354d5b91759a911eaf1171
44+ # https://help.sap.com/viewer/17d50220bcd848aa854c9c182d65b699/Latest/en-US/17efa217f7f34a9eba53d7b209ca4280.html#loio5701672c35354d5b91759a911eaf1171
4545 && sudo -u ${USERNAME} npm set @sap:registry=https://npm.sap.com -g \
46- && sudo -u ${USERNAME} npm update npm -g \
47- # Install global node modules for SAP CAP and frontend development.
46+ # Install global node modules for SAP CAP and frontend development.
4847 && npm config set registry https://registry.npmjs.org/ \
49- # //TODO #1
50- # https://stackoverflow.com/questions/57534295/npm-err-tracker-idealtree-already-exists-while-creating-the-docker-image-for
51- # solution added
52- # WORKDIR /usr/app
53- # COPY ./ ./
54- # keytar - Node module to manage system keychain (VSCode keytar)
55- && npm i keytar \
48+ # Keytar - Node module to manage system keychain (VSCode keytar)
49+ && sudo -s npm i keytar \
5650 && sudo -u ${USERNAME} npm i @sap/cds-dk \
57- -g mta \
51+ -g mta \
5852 -g mbt \
5953 -g yo \
6054 -g @sap/generator-base-mta-module \
61- -g @sap/generator-fiori \
55+ -g @sap/generator-fiori \
6256 -g yo generator-easy-ui5 \
6357 -g @ui5/cli \
6458 @sapui5/generator-sapui5-templates \
@@ -67,69 +61,34 @@ RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then \
6761 @sap/generator-fiori \
6862 @sap/generator-hdb-project \
6963 @sap/hana-client \
70- hana-cli
71-
72- # # # Install kubectl (K8s)
73- RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl \
74- && chmod +x ./kubectl \
75- && mv ./kubectl /usr/local/bin
76-
77- # create directory for mounting .kube
78- RUN cd /usr/local/share && sudo -s mkdir kube-devcontainer \
79- && sudo -s chmod 700 ./kube-devcontainer/ \
80- && sudo -s chown --recursive ${USERNAME}:${USERNAME} ./kube-devcontainer/
81-
82- # # # Install extra tools for CAP development & deployment.
83- RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
64+ hana-cli \
65+ # Install extra tools for CAP development & deployment.
66+ && apt-get update && export DEBIAN_FRONTEND=noninteractive \
8467 && apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
85- && apt-get -y install sqlite cf-cli
86-
87- # Install minikube
88- RUN curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \
89- && chmod +x minikube \
90- && sudo -s cp minikube /usr/local/bin && rm minikube
91-
92- # Install Helm
93- RUN wget -q https://get.helm.sh/helm-v3.6.3-linux-amd64.tar.gz -O - | tar -xzO linux-amd64/helm > /usr/local/bin/helm \
94- && chmod +x /usr/local/bin/helm \
95- && chmod g+rwx /root \
96- # && mkdir /config \
97- # && chmod g+rwx /config \
98- && helm repo add "stable" "https://charts.helm.sh/stable" --force-update
99-
100- # Install docker
101- RUN apt-get -y update \
102- && apt-get -y install curl \
103- && apt-get -y install apt-transport-https \
104- && apt-get -y install ca-certificates \
105- && apt-get -y install gnupg \
106- && apt-get -y install lsb-release \
107- && apt-get -y install software-properties-common \
108- && rm -rf /var/lib/apt/lists/*
109-
110- # # Add User node to the docker group
111- RUN sudo -s groupadd docker \
112- && usermod -aG docker ${USERNAME} \
113- && newgrp docker
114-
115- # # Install docker
116- RUN sudo -u ${USERNAME} curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \
117- && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" \
118- && apt-get -y update \
119- && apt-get -y install docker.io
120-
68+ && apt-get -y install sqlite cf-cli \
12169# XS CLI for running against HANA XSA
122- RUN apt-get update \
70+ && apt-get update \
12371 && apt-get install --yes --no-install-recommends procps unzip \
12472 && rm -rf /var/lib/apt/lists/* \
12573 && mkdir --parents ${XSCLI} \
126- && chown --recursive ${USERNAME}:${USERNAME} ${XSCLI}
127-
74+ && chown --recursive ${USERNAME}:${USERNAME} ${XSCLI} \
12875# List all Cloud Foundry CLI plugins to see whether the installation worked.
12976# cf repo-plugins | grep multiapps
13077# cf plugins
131- RUN sudo -u ${USERNAME} cf add-plugin-repo CF-Community https://plugins.cloudfoundry.org \
78+ && sudo -u ${USERNAME} cf add-plugin-repo CF-Community https://plugins.cloudfoundry.org \
13279 && sudo -u ${USERNAME} cf install-plugin blue-green-deploy -f -r CF-Community \
13380 && sudo -u ${USERNAME} cf install-plugin multiapps -f -r CF-Community \
134- && sudo -u ${USERNAME} cf install-plugin -f https://github.com/cloudfoundry-incubator/multiapps-cli-plugin/releases/latest/download/multiapps-plugin.linux64
135-
81+ && sudo -u ${USERNAME} cf install-plugin -f https://github.com/cloudfoundry-incubator/multiapps-cli-plugin/releases/latest/download/multiapps-plugin.linux64 \
82+ # =========================
83+ # ADD ADDITIONAL FEATURES
84+ # =========================
85+ # RUN chmod +x 1-kubectl \
86+ # && ./1-kubectl
87+ # RUN chmod +x 2-kube-devcontainer \
88+ # && ./2-kube-devcontainer
89+ # RUN chmod +x 3-minikube \
90+ # && ./3-minikube
91+ # RUN chmod +x 4-helm \
92+ # && ./4-helm
93+ # RUN chmod +x 5-docker \
94+ # && ./5-docker
0 commit comments