Where my files exist in Docker image? - qt

I'll switch to container based infrastructure in my Travis-CI builds. So
I wrote following commands in my Dockerfile, image was successfully built:
RUN apt-get install software-properties-common -y
RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y
RUN apt-get update
RUN apt-get install gcc-4.9 -y
RUN apt-get install build-essential perl python git -y
RUN apt-get install "^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-dev -y
RUN apt-get install libedit-dev -y
RUN apt-get install flex bison gperf libicu-dev libxslt-dev -y
RUN git clone git://code.qt.io/qt/qt5.git qt5
RUN cd qt5 && perl init-repository
RUN unset QTDIR
RUN export PATH="$PWD/qtbase/bin:$PWD/qtrepotools/bin:$PATH"
RUN cd qt5 && ./configure -developer-build -opensource -confirm-license -nomake examples -nomake tests
RUN cd qt5 && make
RUN cd qt5 && make install
RUN git clone git://code.qt.io/qt-creator/qt-creator.git qt-creator
RUN mkdir qt-creator-build
RUN cd qt-creator-build
RUN ../qt5/qtbase/bin/qmake -r ../qt-creator/qtcreator.pro
RUN make -j5
Before I push it to Docker Hub I need to know where is my stuff was created in the image. I need something like map of my files for getting access from Travis-CI. Please help me to understand. Thanks
UPD: actually, I need only an absolute path of qt-creator-build folder.

Based on your commands, the absolute path to the qt-creator-build folder should be /qt-creator-build, as the root directory / is the default working directory for every docker command.
That said, the command RUN make -j5 should probably be RUN cd qt-creator-build && make -j5, but only if you actually want to run make -j5 inside qt-creator-build, and that's what I understood from your code.
From the docs of Docker, you can use the WORKDIR command to change de working directory, like:
WORKDIR qt-creator-build

Related

Permision denied for dotnet

I recently installed dotnet 5.0 on Pop OS but whenever I try to use it it says that I don't have permission.
For example, if I just try to run the command dotnet it gives the the message
cannot snap-exec: cannot exec "/snap/dotnet-sdk/144/snap/command-chain/snapcraft-runner": permission denied
When I run the command as the root user it works perfectly fine.
I don't know if this is because I installed dotnet as a snap package
I had the same issue and unfortunately the dotnet issue page was not working.
To fix this issue I had to install the package with apt instead of snap.
sudo snap remove dotnet-sdk // if needed
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt update
sudo apt install apt-transport-https
sudo apt-get install -y dotnet-sdk-5.0
Remove snap first
sudo snap remove dotnet-sdk
Manually download Dotnet SDK https://dotnet.microsoft.com/en-us/download/dotnet/6.0
When your download completes, open the terminal and run the following commands to extract the SDK to make the commands available at the terminal.
mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-6.0.101-linux-x64.tar.gz -C $HOME/dotnet
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet
one last thing
Edit shell profile to permanently

How to install a specific version of node in a Ubuntu environment

When I docker run -it wordpress:php7.0-apache I could execute all of those following command
FROM wordpress:php7.0-apache
RUN apt-get update
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
RUN /bin/dash ~/.profile
RUN /bin/dash nvm install 8.11.4
My issue is when I try to docker build -t imageName:version I would have an error :
/bin/dash: 0: Can't open nvm
The command '/bin/sh -c /bin/dash nvm install 8.11.4' returned a non-zero code: 1277
What could be the difference ?
Thank you David Maze. Indeed there is no need of nvm to install a specific version.
My Dockerfile now :
FROM wordpress:php7.0-apache
RUN apt-get update && apt-get install -y gnupg gnupg2 gnupg1
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get install -y nodejs

jupyter lab (not pip installed but GitHub code) not loading icons when opened via docker

I am trying to load JupyterLab (by building the GitHub source code and not installing it using 'pip'), by opening it via a docker container, but it is not loading the icons which are accessed by css variables (e.g. :- background_image = var(--jp-terminal)). To be precise only the python icons for 'Notebook' and 'Console' are loading because they are loaded by html tags. The rest are loaded by variables as mentioned before.
My current directory looks like this :-
bin docker jupyterlab
The 'bin' folder contains the 'run.sh' file, the 'docker' folder contains the 'Dockerfile' and the 'jupyter lab' folder contains the source code and files for jupyter lab taken from GitHub.
Here is my Dockerfile :-
FROM centos:latest
RUN yum -y install epel-release \
yum -y install python-devel.x86_64 python27-python-devel.x86_64 gcc \
yum -y install nodejs \
yum -y install python-pip \
yum -y install sudo
RUN pip install --upgrade setuptools pip
RUN yum -y update
COPY jupyterlab /jupyterlab
RUN cd /jupyterlab && pip install -e . && jlpm install && jlpm run build && jlpm run build:core && jupyter lab build
COPY bin/run.sh /run.sh RUN chmod +x /run.sh
EXPOSE 8888
ENTRYPOINT ["/bin/sh", "/run.sh"]
Here is the 'run.sh' file which is used as entrypoint :-
jupyter notebook --generate-config
mkdir -p -m 700 /home/jupyter/.jupyter/ && echo "c.NotebookApp.token = ''" >> /home/jupyter/.jupyter/jupyter_notebook_config.py
jupyter lab --ip=* --no-browser --allow-root
Any suggestions?

SQLite Browser without SQLCipher support in Ubuntu

SQLite Browser package for ubuntu does not come with SQLCipher by default.
sudo add-apt-repository -y ppa:linuxgndu/sqlitebrowser
sudo apt-get update
sudo apt-get install sqlitebrowser
The Question
How could it be enabled in order to be able to view encrypted databases?
What Versions
Ubuntu 17.10
SQLite Browser 3.10.99
Qt 5.9.1
SQLite 3.19.3
Update
https://github.com/sqlitebrowser/sqlitebrowser/blob/master/BUILDING.md#ubuntu--debian-linux
$ sudo apt install build-essential git cmake libsqlite3-dev qtchooser qt5-qmake qtbase5-dev-tools\
qttools5-dev-tools libsqlcipher-dev qtbase5-dev libqt5scintilla2-dev libqcustomplot-dev\
qttools5-dev
$ git clone https://github.com/sqlitebrowser/sqlitebrowser
$ cd sqlitebrowser
$ mkdir build
$ cd build
$ cmake -Dsqlcipher=1 -Wno-dev ..
$ make
$ sudo make install
Legacy
The solution is to build SQLite Browser with libsqlcipher-dev package.
Here the steps required:
First install the libsqlcipher-dev package.
sudo apt-get install libsqlcipher-dev
Then install requisites for building SQLite Browser.
sudo apt install build-essential git cmake libsqlite3-dev \
qt5-default qttools5-dev qttools5-dev-tools
Clone repository.
git clone https://github.com/sqlitebrowser/sqlitebrowser
Build steps:
cd sqlitebrowser
mkdir build
cd build
cmake -Dsqlcipher=1 -Wno-dev ..
make
sudo make install
This should complete without errors, giving you a binary file called sqlitebrowser which has now SQLCipher support.

Docker NPM Install Not working

I want to expose my asp.net core application in docker. However i can't get NPM to work. I tried the following below but i get the message that NPM is not found. However i installed nodejs, so i guess it should be available.
Any idea what i'm doing wrong ?
FROM microsoft/aspnet:1.0.0-rc1-update1-coreclr
ADD package.json /tmp/package.json
RUN printf "deb http://ftp.us.debian.org/debian jessie main\n" >> /etc/apt/sources.list
RUN apt-get -qq update && apt-get install -qqy sqlite3 libsqlite3-dev && rm -rf /var/lib/apt/lists/*
RUN apt-get update
RUN apt-get -y install nodejs && cd /tmp && npm install
COPY . /app
WORKDIR /app
RUN ["dnu", "restore"]
EXPOSE 5001/tcp
ENTRYPOINT ["dnx", "-p", "project.json", "web"]
Older versions of Node did not have npm bundled with them. On some Linux distributions, the version of Node in the repository is quite old e.g. on centos it is something like 0.10.7.
It is likely that your application requires a certain version of nodejs to be installed. If this is so, you will need to add the relevant repository to your virtual machine as part of the dockerfile before running
apt-get -y install nodejs
This link gives some details of how to do this on your distribution:
https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions.
If on the other hand you are happy with whatever version of Node your distribution has in its repo, then Suresh Koya's answer is fine.
On linux npm has to be installed separate than nodejs.
You need to add:
RUN apt-get -y install npm
http://blog.teamtreehouse.com/install-node-js-npm-linux
As you can see here:
https://hub.docker.com/r/microsoft/aspnet/~/dockerfile/
FROM mono:4.0.1
mono:4.0.1:
FROM debian:wheezy
Why do you use the jessie ?
RUN printf "deb http://ftp.us.debian.org/debian jessie main\n" >> /etc/apt/sources.list
FROM microsoft/aspnet:1.0.0-rc1-update1-coreclr
ADD package.json /tmp/package.json
RUN printf "deb http://ftp.us.debian.org/debian jessie main\n" >> /etc/apt/sources.list
RUN apt-get -qq update && apt-get install -qqy sqlite3 libsqlite3-dev && \
apt-get -y install nodejs npm && cd /tmp && npm install && \
rm -rf /var/lib/apt/lists/*
COPY . /app
WORKDIR /app
RUN ["dnu", "restore"]
EXPOSE 5001/tcp
ENTRYPOINT ["dnx", "-p", "project.json", "web"]

Resources