Cannot build tauri on docker - docker

I am trying to compile tauri in docker. I am a using a vscode dev container to acheive this
This is my docker file.
ARG VARIANT="buster"
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
# ** [Optional] Uncomment this section to install additional packages. **
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends libwebkit2gtk-4.0-dev \
build-essential \
curl \
wget \
libssl-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev
After this I ran sh <(curl https://create.tauri.app/sh) to initialize a react-ts project.
Result from npm run tauri build
process didn't exit successfully: `rustc --crate-name gtk --edition=2021 /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/gtk-0.15.5/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="v3_20"' --cfg 'feature="v3_22"' -C metadata=269cf64cd449de3a -C extra-filename=-269cf64cd449de3a --out-dir /workspaces/dashboard/MaterialGUI/src-tauri/target/release/deps -L dependency=/workspaces/dashboard/MaterialGUI/src-tauri/target/release/deps --extern atk=/workspaces/dashboard/MaterialGUI/src-tauri/target/release/deps/libatk-20762cb838ce1b94.rmeta --extern bitflags=/workspaces/dashboard/MaterialGUI/src-tauri/target/release/deps/libbitflags-26685d3681f76461.rmeta --extern cairo=/workspaces/dashboard/MaterialGUI/src-tauri/target/release/deps/libcairo-3ae5a994bfb06465.rmeta --extern field_offset=/workspaces/dashboard/MaterialGUI/src-tauri/target/release/deps/libfield_offset-7691c47f3feb9e00.rmeta --extern futures_channel=/workspaces/dashboard/MaterialGUI/src-tauri/target/release/deps/libfutures_channel-d681bcc7e6876e30.rmeta --extern gdk=/workspaces/dashboard/MaterialGUI/src-tauri/target/release/deps/libgdk-484a5289404616b8.rmeta --extern gdk_pixbuf=/workspaces/dashboard/MaterialGUI/src-tauri/target/release/deps/libgdk_pixbuf-b9619cc328c2dbcd.rmeta --extern gio=/workspaces/dashboard/MaterialGUI/src-tauri/target/release/deps/libgio-c77d2cecfc1e3d8d.rmeta --extern glib=/workspaces/dashboard/MaterialGUI/src-tauri/target/release/deps/libglib-9cc08b7061dbd8d4.rmeta --extern ffi=/workspaces/dashboard/MaterialGUI/src-tauri/target/release/deps/libgtk_sys-35489357e3141ff5.rmeta --extern gtk3_macros=/workspaces/dashboard/MaterialGUI/src-tauri/target/release/deps/libgtk3_macros-3da6229495a7d507.so --extern libc=/workspaces/dashboard/MaterialGUI/src-tauri/target/release/deps/liblibc-0a1a4bd76c39e5ee.rmeta --extern once_cell=/workspaces/dashboard/MaterialGUI/src-tauri/target/release/deps/libonce_cell-6dbe5493a8f63ba6.rmeta --extern pango=/workspaces/dashboard/MaterialGUI/src-tauri/target/release/deps/libpango-6c2dd8fe6fc5b056.rmeta --cap-lints allow --cfg 'gdk_backend="x11"' --cfg 'gdk_backend="broadway"' --cfg 'gdk_backend="wayland"'` (signal: 9, SIGKILL: kill)
I already have xquartz installed

Related

How to add symbolic link or alias to dockerfile?

I have the following dockerfile:
FROM python:3.10-alpine
LABEL Name=my_app
WORKDIR /app
RUN addgroup --gid 1000 -S my_app && \
adduser --uid 1000 -D -S my_app -G my_app -s /sbin/nologin
COPY --chown=1000:1000 pyproject.toml README.rst src ./
RUN apk add --no-cache --virtual=.build-deps build-base libffi-dev curl openssl-dev && \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
source $HOME/.cargo/env && \
pip install --upgrade pip && pip install --no-cache-dir ./ && \
apk del .build-deps && \
rustup self uninstall -y
RUN chown -R 1000:1000 /app
USER my_app
It is working and I am capable to run inside of this container the following command: my_app run --checks all path_name. Because some reason I need to change my_app key phrase to my_app_2 key phrase. So I would able to run the following command: my_app_2 run --checks all path_name. I cannot change underling files outside of dockerfile because of some server configuration. What changes in dockerfile could I make?
I tried to add:
RUN ln -s /usr/local/bin/my_app /usr/local/bin/my_app_2
But getting an error during build prosses::
=> ERROR [7/7] RUN ln -s /usr/local/bin/my_app /usr/local/bin/my_app 0.3s
------
> [7/7] RUN ln -s /usr/local/bin/my_app /usr/local/bin/my_app_2:
#0 0.256 ln: /usr/local/bin/my_app_2: Permission denied
------
failed to solve: executor failed running [/bin/sh -c ln -s /usr/local/bin/my_app /usr/local/bin/my_app_2]: exit code: 1
Also I tried to swap my_app_2 and my_app:
RUN ln -s /usr/local/bin/my_app_2 /usr/local/bin/my_app
But getting another error during build prosses:
=> ERROR [7/7] RUN ln -s /usr/local/bin/my_app_2 /usr/local/bin/my_app 0.5s
------
> [7/7] RUN ln -s /usr/local/bin/my_app_2 /usr/local/bin/my_app:
#0 0.516 ln: /usr/local/bin/my_app: File exists
------
failed to solve: executor failed running [/bin/sh -c ln -s /usr/local/bin/my_app_2 /usr/local/bin/my_app]: exit code: 1
Third attempt. I added:
RUN echo "alias my_app_2='my_app'" >> ~/.bashrc
Built was successful but when I run
my_app_2 run --checks all my_path_here
I am getting:
sh: my_app_2: not found
Run the command while you are still root. Unprivileged users can't modify arbitrary files on the filesystem:
FROM python:3.10-alpine
LABEL Name=my_app
WORKDIR /app
RUN addgroup --gid 1000 -S my_app && \
adduser --uid 1000 -D -S my_app -G my_app -s /sbin/nologin
COPY --chown=1000:1000 pyproject.toml README.rst src ./
RUN apk add --no-cache --virtual=.build-deps build-base libffi-dev curl openssl-dev && \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
source $HOME/.cargo/env && \
pip install --upgrade pip && pip install --no-cache-dir ./ && \
apk del .build-deps && \
rustup self uninstall -y
# run other steps as root here
RUN ln -s /usr/local/bin/my_app /usr/local/bin/my_app_2
RUN chown -R 1000:1000 /app
USER my_app
# you are no longer root here

Docker image build failed with error "Operation not permitted"

I am getting docker image build error "Operation not permitted". chmod 777 R /PredictionIO-0.14.0/lib/spark/ did not solve it.
I am trying to create PredictionIO docker image through git CICD to run in K8t
pio build --verbose
[INFO] DOCKER> [91mls: cannot access '/PredictionIO-0.14.0/lib/spark/pio-data-elasticsearch-assembly-0.14.0.jar': Operation not permitted ls: cannot access '/PredictionIO-0.14.0/lib/spark/pio-data-hbase-assembly-0.14.0.jar': Operation not permitted
[INFO] DOCKER> [91mls: cannot access '/PredictionIO-0.14.0/lib/spark/pio-data-hdfs-assembly-0.14.0.jar': Operation not permitted
ls: cannot access '/PredictionIO-0.14.0/lib/spark/pio-data-jdbc-assembly-0.14.0.jar': Operation not permitted
ls: cannot access '/PredictionIO-0.14.0/lib/spark/pio-data-localfs-assembly-0.14.0.jar': Operation not permitted
ls: cannot access '/PredictionIO-0.14.0/lib/spark/pio-data-s3-assembly-0.14.0.jar': Operation not permitted
[INFO] DOCKER> [91mError: Could not find or load main class org.apache.predictionio.tools.console.Console
[INFO] DOCKER> Removing intermediate container 8c164b439d1b
[ERROR] DOCKER> Unable to build image [myimage/bellmedia-pio-0.14.0:latest] : "The command '/bin/sh -c pio build --verbose' returned a non-zero code: 1" ["The command '/bin/sh -c pio build --verbose' returned a non-zero code: 1" ]
Dockerfile
FROM openjdk:8
MAINTAINER Jhon
ARG HTTP_PROXY=http://myproxyServer:8083/
ARG HTTPS_PROXY=http://myproxyServer:8083/
ENV DEBIAN_FRONTEND noninteractive
RUN export http_proxy=${HTTP_PROXY} \
&& export https_proxy=${HTTPS_PROXY} \
&& apt-get update && \
apt-get install -y net-tools curl patch gawk g++ gcc make libc6-dev vim telnet bash patch libreadline6-dev zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 autoconf libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev libffi-dev krb5-user libpam-krb5 libpam-ccreds python3-pip tini libc6 libpam-modules libnss3 cron
ENV PIO_VERSION 0.14.0
ENV SPARK_VERSION 2.4.4
ENV ELK_VERSION 5.6.9
ENV SCALA_VERSION 2.11.12
ENV HBASE_VERSION 1.0.0
ENV HADOOP_VERSION 2.7
ENV PIO_GIT_URL http://archive.apache.org/dist/predictionio/
ENV PIO_HOME /PredictionIO-${PIO_VERSION}
ENV PATH=${PIO_HOME}/bin:/PredictionIO-0.14.0/vendors/spark-2.4.4-bin-hadoop2.7/bin:$PATH
ENV JAVA_HOME /usr/local/openjdk-8
EXPOSE 9200 9300
RUN export http_proxy=${HTTP_PROXY} \
&& export https_proxy=${HTTPS_PROXY} \
&& curl -O https://archive.apache.org/dist/predictionio/${PIO_VERSION}/apache-predictionio-${PIO_VERSION}.tar.gz
RUN mkdir predictionio
RUN tar -zxf apache-predictionio-${PIO_VERSION}.tar.gz -C /predictionio \
&& rm apache-predictionio-${PIO_VERSION}.tar.gz
COPY sbt-launch.jar /root/.sbt/launchers/1.2.3/
WORKDIR /predictionio
RUN export http_proxy=${HTTP_PROXY} \
&& export https_proxy=${HTTPS_PROXY} \
&& ./make-distribution.sh -Dscala.version=${SCALA_VERSION} -Dspark.version=${SPARK_VERSION} -Delasticsearch.version=${ELK_VERSION}
WORKDIR /
RUN tar -zxvf predictionio/PredictionIO-${PIO_VERSION}.tar.gz \
&& rm predictionio/PredictionIO-${PIO_VERSION}.tar.gz
COPY pio-env.sh ${PIO_HOME}/conf/
COPY log4j.properties ${PIO_HOME}/conf/
RUN mkdir ${PIO_HOME}/vendors
WORKDIR ${PIO_HOME}/vendors
RUN export http_proxy=${HTTP_PROXY} \
&& export https_proxy=${HTTPS_PROXY} \
&& curl -O https://archive.apache.org/dist/spark/spark-${SPARK_VERSION}/spark-${SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}.tgz
RUN tar -zxvf spark-${SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}.tgz \
&& rm spark-${SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}.tgz
COPY spark-defaults.conf spark-${SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}/conf/
WORKDIR ${PIO_HOME}
RUN export http_proxy=${HTTP_PROXY} \
&& export https_proxy=${HTTPS_PROXY} \
&& mkdir URM \
&& cd URM \
&& git clone https://github.com/actionml/universal-recommender.git
COPY build.sbt /PredictionIO-0.14.0/URM/universal-recommender/
COPY engine.json /PredictionIO-0.14.0/URM/universal-recommender/
RUN rm -rf target
RUN ln -s /PredictionIO-0.14.0/vendors/spark-2.4.4-bin-hadoop2.7/ /opt/spark
WORKDIR ${PIO_HOME}/URM/universal-recommender/
RUN mkdir lib
COPY sbt-launch.jar /root/.sbt/launchers/0.13.13/
RUN export SBT_OPTS="-Dhttp.proxyHost=myproxy.ca -Dhttp.proxyPort=8083 -Dhttps.proxyHost=myproxy.ca -Dhttps.proxyPort=8083"
RUN chmod 777 -R /PredictionIO-0.14.0/lib/spark/
########################### Command below is failing ##################
RUN export http_proxy=${HTTP_PROXY} \
&& export https_proxy=${HTTPS_PROXY} \
&& pio build --verbose
CMD ["sh", "-c", "tail -f /dev/null"]
Any suggestion is highly applicated.
Thanks
Jhon

How do i dockerize a sagemath server?

i've been using sagemath for a few weeks now, and i've been experiencing some downtime. i saw that i am able to make my own sagemath server, so what i'm trying to do is that i want to dockerize it but am unable to do so, i've followed the documentation on the github but im unable to run docker build . to run the Dockerfile. Is it possible to dockerize a sagemath server?
FROM node:alpine
RUN ln -s /usr/bin/nodejs /usr/bin/node
RUN npm install -g requirejs
RUN apk update && apk add git
RUN git clone https://github.com/sagemath/sage.git
#temporarily run nocache flag to speed up the runtime
#install python?
RUN apk add --no-cache python3 py3-pip
#install gcc
RUN apk add --no-cache gcc musl-dev
#install bash to process the next few commands
RUN apk add --no-cache bash
RUN /bin/bash -c " \
pushd sage; \
./bootstrap/; \
./configure --enable-download-from-upstream-url/; \
make; \
popd; \
sage/sage -pip install lockfile; \
sage/sage -pip install sockjs-tornado; \
sage/sage -pip install sqlalchemy; \
sage/sage -pip install paramiko; \
"
RUN git clone https://github.com/sagemath/sagecell.git
RUN /bin/bash -c " \
pushd sagecell; \
"
RUN git submodule update --init --recursive \
RUN ../sage/sage -sh -c \
make; \
../sage/sage web_server.py [-p 8888] \
The command prompt just exploded me with a bunch of error messages, this is just a small amount of it
#13 173.2 ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t4f6ko9s/cffi_04531dcfd0fd4757914fa4410902e57d/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t4f6ko9s/cffi_04531dcfd0fd4757914fa4410902e57d/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install
--record /tmp/pip-record-ldckhbb6/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.8/cffi Check the logs for full command output.
------
executor failed running [/bin/sh -c /bin/bash -c " pushd sage; ./bootstrap/; ./configure --enable-download-from-upstream-url/; make; popd; sage/sage -pip install lockfile; sage/sage -pip install sockjs-tornado; sage/sage -pip install sqlalchemy; sage/sage -pip install paramiko; "]: exit code: 1

Shopware 6 - docker:start fails with non-zero code: 2

First I pull this repo: https://github.com/shopware/development
Then I want to start a demo shop with command ./psh.phar docker:start in the repo directory.
Then this error appears, and the containers are not biult:
Building app_mysql ... done
Successfully tagged shopware-test_app_mysql:latest
---> Running in e0e02269e83d
Listen 8000
Warning: apt-key output should not be parsed (stdout is not a terminal)
gpg: no valid OpenPGP data found.
ERROR: for app_server (<Service: app_server>, 'The command \'/bin/sh -c sed -ri -e \'s!VirtualHost \\*:80!VirtualHost \\*:8000!g\' /opt/docker/etc/httpd/vhost.conf && echo "Listen 8000" | tee -a /etc/apache2/ports.conf && curl -sL https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && sh -c \'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list\' && curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - && sh -c \'echo "deb [arch=amd64] https://download.docker.com/linux/debian stretch stable" >> /etc/apt/sources.list.d/docker.list\' && mkdir -p /usr/share/man/man1 && curl -sL https://deb.nodesource.com/setup_12.x | bash && mkdir -p ${NPM_CONFIG_CACHE} && apt-install default-mysql-client nodejs google-chrome-stable libicu-dev graphviz vim gnupg2 docker-ce=5:18.09.7~3-0~debian-stretch libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb && npm install -g npm#^6.14.11 && npm i forever -g && chown -R ${USER_ID}:${GROUP_ID} ${NPM_CONFIG_CACHE} && ln -s /app/psh.phar /bin/psh && pecl install pcov && docker-php-ext-enable pcov\' returned a non-zero code: 2')
Service 'app_server' failed to build: The command '/bin/sh -c sed -ri -e 's!VirtualHost \*:80!VirtualHost \*:8000!g' /opt/docker/etc/httpd/vhost.conf && echo "Listen 8000" | tee -a /etc/apache2/ports.conf && curl -sL https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - && sh -c 'echo "deb [arch=amd64] https://download.docker.com/linux/debian stretch stable" >> /etc/apt/sources.list.d/docker.list' && mkdir -p /usr/share/man/man1 && curl -sL https://deb.nodesource.com/setup_12.x | bash && mkdir -p ${NPM_CONFIG_CACHE} && apt-install default-mysql-client nodejs google-chrome-stable libicu-dev graphviz vim gnupg2 docker-ce=5:18.09.7~3-0~debian-stretch libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb && npm install -g npm#^6.14.11 && npm i forever -g && chown -R ${USER_ID}:${GROUP_ID} ${NPM_CONFIG_CACHE} && ln -s /app/psh.phar /bin/psh && pecl install pcov && docker-php-ext-enable pcov' returned a non-zero code: 2
Execution aborted, a subcommand failed!
The same happens when I run docker-compose up.
What is the problem there?
I run Xubuntu 18.04. This used to work fine a few weeks ago. What could have happened?
I also opened an issue on Github: https://github.com/shopware/development/issues/161
If you take a look into the error, here:
curl -sL https://dl-ssl.google.com/linux/linux_signing_key.pub |
apt-key add -
download the key and try to use it, but gives you this error:
Warning: apt-key output should not be parsed (stdout is not a terminal)
You should check if in your environment docker is able to download that key and use it
I kind of solved this by updating Xubuntu from 18.04 to 20.04. The apt-key output error remains, but otherwise the containers get built.
I had this issue on ubuntu 22 when docker-compose was not installed, so just run:
sudo apt install docker-compose

cant' build docker file for my service because of pip-req file not found error

i have created a Dockerfile that creates virtual env, installs all libs and activates that virtual env for further use.
the dockerfile:
FROM debian:9.4-slim
##################################################
# Install Anaconda 3:
##################################################
RUN apt-get update && apt-get install -y \
--fix-missing \
build-essential \
cmake \
gfortran \
git \
wget \
curl \
graphicsmagick \
libgraphicsmagick1-dev \
libatlas-dev \
libavcodec-dev \
libavformat-dev \
libgtk2.0-dev \
libjpeg-dev \
liblapack-dev \
libswscale-dev \
pkg-config \
python3-dev \
python3-numpy \
software-properties-common \
zip \
&& apt-get clean && rm -rf /tmp/* /var/tmp/* \
&& curl -o miniconda_install.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& bash miniconda_install.sh -b -p ~/anaconda3 \
&& echo 'export PATH="~/anaconda3/bin:$PATH"' >> ~/.bashrc \
&& ~/anaconda3/bin/conda update -n base conda \
&& rm miniconda_install.sh \
&& rm -rf /var/lib/apt/lists/* \
&& /bin/bash -c "source ~/.bashrc"
ENV PATH="~/anaconda3/bin:${PATH}"
##################################################
# Setup env for current project:
##################################################
EXPOSE 1487 1488
RUN /bin/bash -c "conda create -y -n voice"
ADD erjan_environment_var_for_voice.txt /tmp/setup/requirements.txt
RUN /bin/bash -c "source activate voice"
RUN /bin/bash -c "pip install -r /tmp/setup/requirements.txt"
WORKDIR /Service
ADD Service /Service
ENTRYPOINT ["/bin/bash", "-c", "source activate voice && ./run.sh"]
when running this command:
sudo docker build . -t jysan_bank:dev
the error:
ERROR: Command errored out with exit status 1:
command: /root/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-1mbm1qnz/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-1mbm1qnz/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-req-build-1mbm1qnz/pip-egg-info
cwd: /tmp/pip-req-build-1mbm1qnz/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/root/anaconda3/lib/python3.7/tokenize.py", line 447, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-1mbm1qnz/setup.py'
I got this dockerfile from a similar project, it runs ok. I changed the requirements.txt file to include libs i needed.
why does it not work and asking for some file tmp/pip-req?

Resources