How to run a CLion project in a docker container - docker

I have the following CLion project:
/home/me/CLionProjects/myProject
This is the output of my docker images:
:sudo docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
tensorflow/tensorflow devel 61e124a9cc92 17 hours ago 1.96GB
ubuntu 16.04 b6f507652425 9 months ago 135MB
This project requires tensorflow-lite so I want to be able to compile the project inside the tensorflow/tensorflow image, which comes from this page in the Docker Hub.

Related

Build C++ project against docker container not image

I just started learning Docker and trying to build a C++ project for Windows on Ubuntu.
For that I use this project which almost works, but I have linking error, particularly it fails to link against libssh.
I run the build of my project using this command:
sudo docker run -v $PWD:/project/source -v $PWD/build_docker:/project/build my_qt_cross_win:qttools
where my_qt_cross_win:qttools is the image that I built by git cloning original repo and added some missing libraries.
Since building it takes 2 hours, because it builds the whole system, and I just need to fix this minor linking issue, I would like to just add the proper libssh.a to the container that was instanced from my_qt_cross_win:qttools image and build my project using that modified container. But it feels like I can use only images for that, because docker complains
Unable to find image 'musing_chebyshev:latest' locally
when I try to use container name or id instead of an image.
$ sudo docker container ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d207fd2d9dd8 my_qt_cross_win:qttools "/bin/sh -c 'qmake /…" 11 minutes ago Exited (2) 10 minutes ago musing_chebyshev
Is there any way I can use a modified container to build my project?
I simply needed to copy the missing file to the existing container:
sudo docker cp -a d207fd2d9dd8:/usr/lib/x86_64-linux-gnu/libssh.a .
And then commit the changes to the container to create a new image:
sudo docker commit d207fd2d9dd8 my_qt_cross_win/libssh_static
Then the new image appeared:
$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
my_qt_cross_win/libssh_static latest 9f7af733526b 21 hours ago 3.43GB
Though it did not solve my original issue, this was the answer I expected to get to reuse my existing container for build. Thanks to #AlanBirtles for the link.

docker images list showing no results even with container running

I have this:
> docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
edf86b00c790 mcr.microsoft.com/mssql/server:2019-CTP2.2-ubuntu "/opt/mssql/bin/sqls…" 3 weeks ago Up 6 days 0.0.0.0:3341->1433/tcp sql2019
PS C:\Users\User
> docker images ls -a
REPOSITORY TAG IMAGE ID CREATED SIZE
PS C:\Users\User
>
Trying to understand how I can be running an image that doesn't appear in the images list.
I'm running
docker --version Docker version 18.09.2, build 6247962
The correct command to list images is: docker images

what is the workaround for the kernel too old error in docker on centos

I just started dockering and here hits my very first docker question.
I am using CentOS release 6.6 (Final).
I need to build a docker image for JupyterHub, here is the JupyterHub image: https://hub.docker.com/r/jupyterhub/jupyterhub/, what I did is:
docker pull jupyterhub/jupyterhub
And then I ran:
sudo docker images
, I see the following:
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
jupyterhub/jupyterhub latest 3726912b8cfc 5 months ago 811.5 MB
<none> <none> 7cdb3c49d61f 2 years ago 4.766 GB
What is the huge none repo that comes with an image id?
When I ran:
sudo docker run --name test 3726912b8cfc
I received:
FATAL: kernel too old
What does it mean? and how to work around with it?
Redhat pulled support for docker on el6 a long time ago. See https://access.redhat.com/solutions/1378023
The 1.7 version of Docker that is in those repositories hasn't received updates since the backport effort was pulled.
Modern Docker images tend to not be tested against old versions of Docker and they could require a newer kernel than centos 6 provides.
The upstream Docker project only provides packages for Centos 7 as of the time of writing of this answer (https://docs.docker.com/install/linux/docker-ce/centos/#os-requirements)
To install Docker CE, you need a maintained version of CentOS 7
Since 2017, running Docker on centos tends to require centos 7 instead of centos 6 for practical usecases.

Kitematic not showing any Images/Containers

I have pulled three images from docker hub using docker.I have listed those three images below
suju#suju-VirtualBox:~$ sudo docker images -a
REPOSITORY TAG IMAGE ID CREATED SIZE
mysql latest 71b5c7e10f9b 11 days ago 477MB
hello-world latest fce289e99eb9 4 weeks ago 1.84kB
java latest d23bdf5b1b1b 2 years ago 643MB
And i installed kitematic 0.17.6 for purpose of Managing Docker container
but when i open kitematic, it doent show any container, its just shows a white window without any options except exit

Cached Docker images on Hosted Linux Preview agent

We are building docker image on VSTS by using VSTS Hosted Linux Preview agent. microsoft/aspnetcore-build image is used to build asp.net core application. Each time build is triggered, an agent is pulling microsoft/aspnetcore-build image from registry and it takes some time. We would like to avoid this, by specifying specific image pre-cached on agents.
Is there a list of container images that have been cached on Hosted Linux Preview agent? Such information is available for Hosted VS2017 agent, but not for Linux one.
No official article mentions it, I submit a user voice here: Docker image cache on Hosted linux agent that you can vote and follow.
According to this documentation the complete list can be found in the following documents:
Details of Ubuntu 18.04 agent image *
Details of Ubuntu 20.04 agent image *
(*) The above are permalinks to a specific snapshot of code (dated 2022-03-26). For the most current data, switch to the "main" branch in GitHub. Note that files may disappear from the 'main' branch when image gets deprecated.
As of 2022-03-26, both images include the same set of pre-cached docker images which are:
alpine:3.12
alpine:3.13
alpine:3.14
buildpack-deps:bullseye
buildpack-deps:buster
buildpack-deps:stretch
debian:10
debian:11
debian:9
moby/buildkit:latest
node:12
node:12-alpine
node:14
node:14-alpine
node:16
node:16-alpine
ubuntu:16.04
ubuntu:18.04
ubuntu:20.04
This can also be confirmed by adding a simple task to the pipeline that runs docker image list. Here's an example of the command's output ran on Ubuntu-16.04 agent (before it was deprecated):
/usr/bin/docker image list
REPOSITORY TAG IMAGE ID CREATED SIZE
node 10-alpine 955e0e1f1a41 11 days ago 80.5MB
node 10 bb78c02ca3bf 11 days ago 908MB
node 12-alpine afd897e3184b 11 days ago 85.2MB
node 12 b6f455933a97 11 days ago 913MB
buildpack-deps stretch c82dad0a8baf 2 weeks ago 835MB
debian 9 92416e205014 2 weeks ago 101MB
debian 8 955c8f8160c2 2 weeks ago 129MB
alpine 3.8 c8bccc0af957 3 weeks ago 4.41MB
alpine 3.9 82f67be598eb 3 weeks ago 5.53MB
alpine 3.10 af341ccd2df8 3 weeks ago 5.56MB
jekyll/builder latest 4605d94a6b36 4 months ago 564MB
alpine 3.7 6d1ef012b567 11 months ago 4.21MB
mcr.microsoft.com/azure-pipelines/node8-typescript latest 9a948d360778 16 months ago 595MB

Resources