Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 months ago.
Improve this question
I need to install Xvfb on Redhat 8, however the usual way doesn't work:
yum -y install xorg-x11-server-Xvfb
No match for argument: xorg-x11-server-Xvfb
Error: Unable to find a match: xorg-x11-server-Xvfb
From here How to install Xvfb (X virtual framebuffer) on Redhat 6.5? I tried the suggestion:
wget http://vault.centos.org/6.2/os/x86_64/Packages/xorg-x11-server-Xvfb-1.10.4-6.el6.x86_64.rpm
yum localinstall xorg-x11-server-Xvfb-1.10.4-6.el6.x86_64.rpm
But that gives:
Error:
Problem: conflicting requests
nothing provides libXdmcp.so.6()(64bit) needed by xorg-x11-server-Xvfb-1.10.4-6.el6.x86_64
nothing provides libXfont.so.1()(64bit) needed by xorg-x11-server-Xvfb-1.10.4-6.el6.x86_64
nothing provides libcrypto.so.10()(64bit) needed by xorg-x11-server-Xvfb-1.10.4-6.el6.x86_64
nothing provides xorg-x11-server-common >= 1.10.4-6.el6 needed by xorg-x11-server-Xvfb-1.10.4-6.el6.x86_64
Is there any way to install Xvfb on RH8?
Create the file /etc/yum.repos.d/centos8.repo
[CentOS-8]
name=CentOS-8
baseurl=http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/
enabled=1
gpgcheck=1
gpgkey=https://www.centos.org/keys/RPM-GPG-KEY-CentOS-Official
Then:
rpm --import https://www.centos.org/keys/RPM-GPG-KEY-CentOS-Official
dnf install -y xorg-x11-server-Xvfb
If you are trying to run something like cypress headless, you might also need some of these:
atk java-atk-wrapper at-spi2-atk gtk3 libXt mesa-libgbm libdrm
The only way to do this (without an RHEL subscription) is to do the following installs which work only when in this order:
yum install -y libXScrnSaver \
mesa-libgbm nss at-spi2-atk libX11-xcb \
ftp://ftp.redhat.com/pub/redhat/rhel/rhel-8-beta/appstream/x86_64/Packages/libxkbfile-1.0.9-9.el8.x86_64.rpm \
ftp://ftp.redhat.com/pub/redhat/rhel/rhel-8-beta/appstream/x86_64/Packages/xorg-x11-xkb-utils-7.7-26.el8.x86_64.rpm \
ftp://ftp.redhat.com/pub/redhat/rhel/rhel-8-beta/appstream/x86_64/Packages/xorg-x11-server-common-1.20.2-5.el8.x86_64.rpm \
ftp://ftp.redhat.com/pub/redhat/rhel/rhel-8-beta/appstream/x86_64/Packages/xorg-x11-xauth-1.0.9-12.el8.x86_64.rpm \
ftp://ftp.redhat.com/pub/redhat/rhel/rhel-8-beta/appstream/x86_64/Packages/libXdmcp-1.1.2-11.el8.x86_64.rpm \
ftp://ftp.redhat.com/pub/redhat/rhel/rhel-8-beta/appstream/x86_64/Packages/libXfont2-2.0.3-2.el8.x86_64.rpm \
ftp://ftp.redhat.com/pub/redhat/rhel/rhel-8-beta/appstream/x86_64/Packages/xorg-x11-server-Xvfb-1.20.2-5.el8.x86_64.rpm;
I don't know why it's so difficult.
The following docker file fixed it for us using UBI 8 openjdk.
We added the CentOS repository and enabled it.
FROM registry.access.redhat.com/ubi8/openjdk-8
USER 0
RUN adduser --system non-root
ARG CERTIFICATES_DIR
# Copy root CA certs
COPY ${CERTIFICATES_DIR}/AAAAAAAAAAAA.crt /etc/pki/ca-trust/source/anchors/
COPY ${CERTIFICATES_DIR}/BBBBBBBBBBBB.crt /etc/pki/ca-trust/source/anchors/
COPY ${CERTIFICATES_DIR}/CCCCCCCCCCCCC.crt /etc/pki/ca-trust/source/anchors/
# Install CA certs
RUN update-ca-trust
RUN mkdir /app && chmod g+rwx /app
ARG APPLICATION_CLASS
ENV APPLICATION_CLASS=${APPLICATION_CLASS}
ARG DEPENDENCY_DIR
COPY ${DEPENDENCY_DIR}/BOOT-INF/lib /app/lib
COPY ${DEPENDENCY_DIR}/META-INF /app/META-INF
COPY ${DEPENDENCY_DIR}/BOOT-INF/classes /app
RUN chmod -R g+rwx /app/*
RUN printf '[CentOS-8]\nname=CentOS-8\nbaseurl=http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/\nenabled=1\ngpgcheck=1\ngpgkey=https://www.centos.org/keys/RPM-GPG-KEY-CentOS-Official' >> /etc/yum.repos.d/ubi.repo
RUN microdnf -y update && \
microdnf -y install freetype fontconfig dejavu-sans-mono-fonts dejavu-serif-fonts dejavu-sans-fonts xorg-x11-server-Xvfb && microdnf clean all
RUN fc-cache --really-force --verbose
RUN mkdir /tmp/.X11-unix \
&& chmod 1777 /tmp/.X11-unix \
&& chown root:root /tmp/.X11-unix/
ENV LANG "en_US.UTF-8"
ENV LC_ALL "en_US.ISO8859-1"
ENV TZ "Europe/Stockholm"
ENV DISPLAY ":99"
USER non-root
EXPOSE 8080 8443
WORKDIR /
ENTRYPOINT ["sh", "-c", "java -cp app:app/lib/* ${PISA_JAVA_OPTS} ${JAVA_OPTIONS} ${APPLICATION_CLASS} & \
Xvfb ${DISPLAY} >> /app/kola/xvfb.log 2>&1"]
Related
I'm running a flutter app on a raspberry pi 4, I'm using flutter-pi. Everything works fine, but I want to take it to a higher level.
I want to encapsulate the app and all flutter-pi dependencies in a docker container.
I am using the ubuntu:jammy image as a base, I have installed all the dependencies according to flutter-pi.
When I run the app I get this error:
[locales] Warning: The system has no configured locale. The default "C" locale may or may not be supported by the app.
[keyboard] Could not load keyboard configuration from "/etc/default/keyboard". Default keyboard config will be used. load_file: No such file or directory
[flutter-pi] Could not query DRM device list: No such file or directory
NOTE: the raspberry is configured to do a console auto login and does not have a graphical interface
I have developed a flutter-pi application and encapsulated it in a container.
What I noticed is that this error (Could not query DRM device list: No such file or directory) happens to me only sometimes, the configuration is always the same but sometimes I faced it and some times I didn't.
I'm assuming it is related with the host system in which the docker containers are running, because as I previously said the configuration of the container is always the same in both the working container and the not working one.
I'm attaching down below the configuration of my dockerfile (it's made of 2 dockerfiles but it's only 1 container that I'm running, the second dockerfile uses the first one which is built in emotionsrl/tower-display-base).
The display_launcher.py only runs the flutter (flutter-pi --release ./spotlink_build) after a few checks that are not related with the rest.
FROM ubuntu
RUN apt -y update \
&& apt -y install git \
&& apt -y install wget \
&& apt -y install build-essential
WORKDIR /TOWER_DISPLAY
# STEP 1 DIPENDENZE
RUN git clone --depth 1 \
https://github.com/ardera/flutter-engine-binaries-for-arm.git \
engine-binaries && cd engine-binaries && ./install.sh
# STEP 2 DIPENDENZE
ENV TZ=Europe/Rome
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt -y install cmake \
libgl1-mesa-dev \
libgles2-mesa-dev \
libegl1-mesa-dev \
libdrm-dev \
libgbm-dev
RUN DEBIAN_FRONTEND='noninteractive' apt -y install ttf-mscorefonts-installer
RUN apt -y install fontconfig \
libsystemd-dev \
libinput-dev \
libudev-dev \
libxkbcommon-dev
#STEP 3 DIPENDENZE
RUN fc-cache
###########################
# COMPILING
RUN git clone https://github.com/ardera/flutter-pi
WORKDIR /TOWER_DISPLAY/flutter-pi/build
RUN cmake ..
RUN make -j `nproc`
RUN make install
FROM emotionsrl/tower-display-base
WORKDIR /TOWER_DISPLAY
COPY spotlink_build ./spotlink_build
COPY display_launcher.py ./display_launcher.py
CMD python3 ./display_launcher.py
i am creating an ECS cluster with docker image library/wordpress:latest and i get the desired task in running state but when i build this image using following Dockerfile and push it to my dockerhub repo and then try to create this cluster using my new image the containers fails by giving Exit code 2
Could you please suggest me what am i doing wrong here?
#Base image
FROM wordpress:latest
LABEL version="latest" maintainer="xxxxxxx <xxxxxx>"
# Update apt
RUN apt-get update
# Add a user for running applications.
RUN useradd apps
RUN mkdir -p /home/apps && chown apps:apps /home/apps
## for apt to be noninteractive
ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN true
# Install all necessary packages
RUN apt-get -y install build-essential libpoppler-cpp-dev pkg-config x11vnc xvfb fluxbox wget wmctrl gnupg2 unzip zip
# Set the Chrome repo.
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
# Install Chrome.
RUN apt-get update && apt-get -y install google-chrome-stable
# Install Chrome driver
RUN wget https://chromedriver.storage.googleapis.com/94.0.4606.61/chromedriver_linux64.zip \
&& unzip chromedriver_linux64.zip \
&& mv chromedriver /usr/bin/chromedriver \
&& chown root:root /usr/bin/chromedriver \
&& chmod +x /usr/bin/chromedriver
# create folder to store requirements.txt file
RUN mkdir /home/automation
RUN mkdir /home/automation/FrontEnd
WORKDIR /home/automation
# Copy config and scripts
COPY requirements.txt ./requirements.txt
COPY TestSuites /home/automation/FrontEnd/TestSuites
COPY Resources /home/automation/FrontEnd/Resources
COPY TestRunner.py /home/automation/FrontEnd
COPY TestRail/ /home/automation/TestRail
COPY run-frontend-tests.sh /home/automation/run-tests.sh
COPY FrontEndResultParser.py /home/automation/FrontEnd/FrontEndResultParser.py
# Install python 3.9 and pip3
RUN apt-get -y install python3-dev python3.9 python3-pip
# Install dependencies
RUN pip install "setuptools==58.0.0"
RUN pip install -r requirements.txt
CMD ["sh", "run-tests.sh"]
i am basically just trying to run a script into the container
I used a worpress image and built my own image out of it, thought it would keep the container up and my script will be executed but that didnt happen. My ECS cluster didnt have any running task, all i saw iin the events was service stage-fe-auto has started 1 tasks: task e83587e734c94f77. and when i opened the task details, it had Exit Code 2 and Working directory /home/app but in my Dockerfile my work directory is differen. Not sure what i did wrong
I'm new to Docker and am trying to create a Docker image with Raspbian base and PowerShell Core installed.
EDIT: Updated Dockerfile to include libicu52 package, which resolved the main error: lack of libpsl-native or dependencies not available. Changed CMD parameters and now have a different error.
Here is my Dockerfile:
# Download the latest RPi3 Debian image
FROM resin/raspberrypi3-debian:latest
# Update the image and install prerequisites
RUN apt-get update && apt-get install -y \
wget \
libicu52 \
libunwind8 \
&& apt-get clean
# Grab the latest tar.gz
RUN wget https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc.2/powershell-6.0.0-rc.2-linux-arm32.tar.gz
# Make folder to put PowerShell
RUN mkdir ~/powershell
# Unpack the tar.gz file
RUN tar -xvf ./powershell-6.0.0-rc.2-linux-arm32.tar.gz -C ~/powershell
# Run PowerShell
CMD pwsh -v
New error:
hostname: you must be root to change the host name
/bin/sh: 1: pwsh: not found
How do I resolve these errors?
Thanks in advance!
Instead of downloading from source and extracting it in your container, I'd recommend using the official apt installer packages for your Dockerfile from Microsoft's official Debian repository as described at:
https://learn.microsoft.com/en-us/powershell/scripting/setup/installing-powershell-core-on-macos-and-linux?view=powershell-6#debian-9
So transforming that to Dockerfile format:
# Install powershell related system components
RUN apt-get install -y \
gnupg curl apt-transport-https \
&& apt-get clean
# Import the public repository GPG keys
RUN curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
# Register the Microsoft's Debian repository
RUN sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch main" > /etc/apt/sources.list.d/microsoft.list'
# Install PowerShell
RUN apt-get update \
&& apt-get install -y \
powershell
# Start PowerShell
CMD pwsh
Alternatively you can also try to start from one of the original Microsoft docker Linux images, but of course then you need to solve then the raspberry installation for yourself:
https://hub.docker.com/r/microsoft/powershell/tags/
I've been following the Hyperledger Composer tutorial. I managed to install Ubuntu 16.04 on Hyper-V on my Windows 10 Enterprise. I then started on the following pre-req installation instructions:
https://hyperledger.github.io/composer/installing/installing-prereqs.html
I ran the prereqs-ubuntu.sh script. It ran fine with no errors. I examined the logs and saw that it had successfully installed npm 5.6.0, node 8.9.4, docker 17.12.x, docker composer 1.13.x, and Python 2.7.12.
However, when I run run $ sudo npm --version
it tells me that the npm command is not found
Same with $ sudo node --version
Not found...?!
Why would that be when the log clearly shows that npm and node where successfuly installed?!
Well, what I did and managed through:
--> install nodejs and npm:
sudo snap install node --classic --channel=8
so you get the latest node8.
--> then to solve "sudo" problem with node specify the npm prefix:
npm config set prefix ~/.node_modules
add the following to .bash_profile
export PATH=$HOME/.node_modules/bin:$PATH
Now the packages will install into your user directory and no permissions will be harmend.
--> install nvm (to get exactly node 8.9 version on the next step):
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
or
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
Verify:
node -v nvm
which should output 'nvm' if the installation was successful.
--> get and set node 8.9 version:
nvm install v8.9.0
nvm use 8.9.0
--> reset PATHs:
echo export PATH="$HOME/npm/bin:$PATH" >> ~/.bashrc
npm config set prefix ~/npm
echo "export NODE_PATH=$NODE_PATH:/home/$USER/npm/lib/node_modules" >> ~/.bashrc && source ~/.bashrc
--> at this stage the docker previous setup shall be destroyed:
docker kill $(docker ps -q)
docker rm $(docker ps -aq)
docker rmi $(docker images dev-* -q)
--> Installing the rest of prereqs:
sudo apt-add-repository -y ppa:git-core/ppa
sudo apt-get update
# install git
sudo apt-get install -y git
# Ensure that CA certificates are installed
sudo apt-get -y install apt-transport-https ca-certificates
# Add Docker repository key to APT keychain
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Update package lists
sudo apt-get update
# Verifies APT is pulling from the correct Repository
sudo apt-cache policy docker-ce
# Install Docker
echo "# Installing Docker"
sudo apt-get -y install docker-ce
# Add user account to the docker group
sudo usermod -aG docker $(whoami)
# Install docker compose
echo "# Installing Docker-Compose"
sudo curl -L "https://github.com/docker/compose/releases/download/1.13.0/docker-compose-$(uname -s)-$(uname -m)" \
-o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# Install unzip, required to install hyperledger fabric.
sudo apt-get -y install unzip
--> now you can install Fabric dev. env. (assuming the rest of prereq components stand available):
npm install -g composer-cli
etc.
I think you need to log out and close the shell. And then restart with the new session, as the shell stores your session.
Also, after installation, the use of sudo is not recommended as mentioned on IBM hyperledger website.
I've got a custom built grafana docker image that I build using
go run build.go build package
This all works fine, and I get a deb image from the process (grafana_4.3.0-1490275845pre1_amd64.deb) as well as a .tar.gz file and an rpm package as well.
When using the dockerfile (essentially copied from grafana/grafana-docker):
FROM debian:jessie
COPY ./grafana.deb /tmp/grafana.deb
RUN apt-get update && \
apt-get -y --no-install-recommends install libfontconfig curl ca-certificates && \
apt-get clean && \
dpkg -i --debug=3773 /tmp/grafana.deb && \
rm /tmp/grafana.deb && \
I get the following error:
dpkg (subprocess): unable to execute installed post-installation script (/var/lib/dpkg/info/grafana.postinst): No such file or directory
dpkg: error processing package grafana (--install):
subprocess installed post-installation script returned error exit status 2
D000001: ensure_diversions: same, skipping
D000002: fork/exec /var/lib/dpkg/info/systemd.postinst ( triggered /etc/init.d )
D000001: ensure_diversions: same, skipping
Errors were encountered while processing:
grafana
Setting up grafana (4.3.0-1490275845pre1) ...
Processing triggers for systemd (215-17+deb8u6) ...
The command '/bin/sh -c apt-get update && apt-get -y --no-install-recommends install libfontconfig curl ca-certificates && apt-get clean && dpkg -i -- debug=3773 --force-all /tmp/grafana.deb && rm /tmp/grafana.deb && curl -L https://github.com/tianon/gosu/releases/download/1.7/gosu-amd64 > /usr/sbin/gosu && chmod +x /usr/sbin/gosu && apt-get remove -y curl && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 1
The obvious issue is (/var/lib/dpkg/info/grafana.postinst): No such file or directory but not knowing anything about dpkg I don't really know where to start trying to debug it. As far as I'm aware, I've not altered the deployment scripts so I'm at a loss to know where the issue has arisen.
As I was developing Grafana on a shared Windows folder, with Grafana running in a Docker container on VirtualBox, it seems that (despite not editing the files) SourceTree or something else edited the source to add Windows new lines which messed up the packaging step. I just used dos2unix to remove newlines and everything started working as expected.
The particular error message was related to newlines in the postinst file, which I debugged manually with bash on the VM.