Closed JosephJeffs closed 4 years ago
The node-rfc
2 is built on Ubuntu 20, which apparently has a newer glibc
version.
You can upgrade the libstdc, like described here for example: https://stackoverflow.com/questions/44773296/libstdc-so-6-version-glibcxx-3-4-20-not-found, or build the node-rfc
from source on your Linux based docker image.
Here image the node-rfc is built on:
#
# Build:
# docker build -f Dockerfile-node -t rfcqa-node .
# docker run --name rfcqa-node -v /home/test/src:/home/www-admin/src -it rfcqa-node
#
# Run:
# docker start -ai rfcqa
#
FROM ubuntu:latest
LABEL maintainer="srdjan.boskovic@.com"
LABEL version="1.0"
LABEL description="RFM Connectors QA"
ARG adminuser=www-admin
ARG nwrfc_local=/usr/local/sap
ARG venv_base=/home/${adminuser}/.virtualenvs
ARG dev_tools="sudo curl wget git unzip vim tree tmux"
ARG dev_libs="build-essential make libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev"
# os update and packages
RUN \
sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \
apt update && apt install -y locales ${dev_tools}
# timezone # https://serverfault.com/questions/683605/docker-container-time-timezone-will-not-reflect-changes
ENV TZ=Europe/Berlin
RUN locale-gen de_DE && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Add admin user
RUN \
adduser --disabled-password --gecos "" ${adminuser} && \
usermod -aG www-data,sudo ${adminuser} && \
echo "${adminuser} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
USER ${adminuser}
WORKDIR /home/${adminuser}
RUN printf "alias e=exit\nalias ..=cd..\nalias :q=exit\nalias ll='ls -l'\nalias la='ls -la'\n" > .bash_aliases
RUN printf "\n# colors\nexport TERM=xterm-256color\n" >> ~/.bashrc
# git configuration
RUN \
git config --global http.sslVerify false && \
git config --global user.name bsrdjan && \
git config --global user.email srdjan.boskovic@sap.com
# essentials
RUN sudo apt install -y ${dev_libs}
# cmake
RUN cd /tmp && \
CMAKE_VERSION=$(curl -s https://api.github.com/repos/Kitware/CMake/releases/latest | grep '"tag_name"' | sed -E 's/.*"v([^"]+)".*/\1/') && \
wget -q https://github.com/Kitware/CMake/releases/latest/download/cmake-${CMAKE_VERSION}.tar.gz && \
tar -xzvf cmake-${CMAKE_VERSION}.tar.gz && \
cd cmake-${CMAKE_VERSION} && \
./bootstrap && \
make -j4 && sudo make install
# sap nw rfc lib
RUN printf "\n# nwrfc sdk \n" >> ~/.bashrc
RUN printf "export SAPNWRFC_HOME=${nwrfc_local}/nwrfcsdk \n" >> ~/.bashrc
USER root
RUN mkdir -p ${nwrfc_local}
COPY /SAP/NWRFCSDK-750-PL6/linux/nwrfcsdk ${nwrfc_local}/nwrfcsdk
RUN chmod -R a+r ${nwrfc_local}/nwrfcsdk && chmod -R a+x ${nwrfc_local}/nwrfcsdk/bin
RUN printf "# include nwrfcsdk\n${nwrfc_local}/nwrfcsdk/lib\n" | tee /etc/ld.so.conf.d/nwrfcsdk.conf
RUN ldconfig && ldconfig -p | grep sap
# pyenv
RUN git clone https://github.com/pyenv/pyenv.git .pyenv
RUN printf 'export PYENV_ROOT="$HOME/.pyenv"\n' >> .bashrc
RUN printf 'export PATH="$PYENV_ROOT/bin:$PATH"\n' >> .bashrc
RUN printf 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi\n' >> .bashrc
ENV PYENV_ROOT /home/${adminuser}/.pyenv
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
RUN pyenv install ${py38}
RUN pyenv install ${py37}
RUN pyenv install ${py36}
# pyenv-virtualenv
RUN git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv
RUN printf 'eval "$(pyenv virtualenv-init -)"\n' >> ~/.bashrc
RUN printf 'export PYENV_VIRTUALENV_DISABLE_PROMPT=1\n' >> ~/.bashrc
RUN bash -ic "pyenv virtualenv ${py36} ${py36venv} && pyenv activate ${py36venv} && pip install --upgrade ${dev_python}"
RUN bash -ic "pyenv virtualenv ${py37} ${py37venv} && pyenv activate ${py37venv} && pip install --upgrade ${dev_python}"
RUN bash -ic "pyenv virtualenv ${py38} ${py38venv} && pyenv activate ${py38venv} && pip install --upgrade ${dev_python}"
RUN printf "pyenv activate ${py38venv}\n" >> ~/.bashrc
# nvm
#USER ${adminuser}
#RUN printf "\n# nvm" >> ~/.bashrc
#RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.3/install.sh | bash
#RUN bash -ic "nvm install lts/dubnium && nvm install lts/erbium && nvm install node && nvm alias default node"
#RUN printf "export PATH=node_modules/.bin:\$PATH\nnvm use default\n\n" >> ~/.bashrc
# yarn
# RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
# RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
# RUN sudo apt-get update && sudo apt-get install --no-install-recommends yarn
# cleanup
RUN sudo rm -rf /var/lib/apt/lists/*
RUN rm -rf /tmp/*
During my testing I was not able to build from source and get working using the node:x base images. I switched to ubuntu:20.04 base image and loaded the version of node I needed on top of it and it worked.
You may want to update the readme.md to indicate the proper supported version of Ubuntu.
Thank you for your help.
@bsrdjan I just ran into this as well and it's because all of the official node
docker images are using slightly older versions of libstdc++6
. Using ubuntu:latest
is not ideal because of the resulting image size plus I want to use the official node docker image.
I haven't found an easy way out of this yet...
GLIBCXX_3.4.25
is what's available in node:buster-slim
and that seems to be the latest version available from node. node-rfc
wants GLIBCXX_3.4.26
.
Is it possible for you to release node-rfc compiled against GLIBCXX_3.4.25
instead of .26
so we can use the official image from node
?
On trying to move to latest version of node-rfc. We have been able to get 1.2.0 working. I have not been able to get the library to load with any release including and above 2.0. We are using version 7.50 of the SDK.
I am running on docker and have tried a number of base images including: node:10 node:14 node:14-alpine ubuntu:16.04
I can get the container to build however when I run the application I get:
I have tried loading apt-get install libstdc++6 but it is already at the latest version.
The Dockerfile I am using is
Any help you could offer would be most welcome.