Tag Archives: docker

Installing docker on Huawei Kunpeng server arm64

Installing docker on Huawei Kunpeng server arm64

 


 

1、 Download of installation package

The required version of the installation package can be downloaded according to the actual needs

https://download.docker.com/linux/ubuntu/dists/xenial/pool/stable/arm64/

2、 Installation procedure

1. Download the installation package

wget https://download.docker.com/linux/ubuntu/dists/xenial/pool/stable/arm64/containerd.io_1.2.6-3_arm64.deb

wget https://download.docker.com/linux/ubuntu/dists/xenial/pool/stable/arm64/docker-ce_19.03.8~3-0~ubuntu-xenial_arm64.deb

wget https://download.docker.com/linux/ubuntu/dists/xenial/pool/stable/arm64/docker-ce-cli_19.03.8~3-0~ubuntu-xenial_arm64.deb

 

2. Installation

Enter the location where the installation package is downloaded and install it

dpkg -i *.deb

Set boot up

systemctl enable docker

Start docker service

systemctl start docker

View docker status

systemctl status docker

 


Docker installation sysdig error: running DKMS build failed, could’t find / var / lib / DKMS / sysdig / 0.27.1/build/ make.log

Docker sysdig installation error:

According to the online https://www.cnblogs.com/lkun/p/7898900.html centos7 install docker monitoring – sysdig (solve installation errors) did not successfully solved
 
Then I saw this reply under Cloudman’s message:

 
1, his host host kernel upgrade, upgrade instructions: yum update – y kernel, using the uname -r see if upgrade success

2. Install yum -y kernel-devel-$(uname -r) to install the kernel header file in the host operating system
Sysdig command: sysdig command

docker container run -it --rm --name=sysdig --privileged=true  --volume=/var/run/docker.sock:/host/var/run/docker.sock  --volume=/dev:/host/dev  --volume=/proc:/host/proc:ro  --volume=/boot:/host/boot:ro  --volume=/lib/modules:/host/lib/modules:ro  --volume=/usr:/host/usr:ro  sysdig/sysdig

Input csysdig:

 

Centos8 solves the problem of “failed to set locale, defaulting to c.utf-8”

Problem description

>
>
>
>
>
>
>
>
>

systemctl status mysqld.service

journalctl -xe


Failed to set locale, defaulting to C.UTF-8
How to solve
To set the system locale, use the localectl command. For example, if you want to use UTF-8 encoded American English (US), run the following command.
download centos docker mirror system default is ISO/IEC 15897 character set
need to utf-8.
to install all of the first character set

dnf install langpacks-en glibc-all-langpacks -y

Set character set

localectl set-locale LANG=en_US.UTF-8

Restart the mysql
bingo!!!!!!
success

Error response from daemon: Conflict: unable to delete 8598c91556dc (must be forced)

>

docker rmi $(docker images | grep "none" | awk '{print $3}')

:
ror response from daemon: conflict: Unable to delete 8598c91556DC (must be forced) – image is being used by stopped container 8f10ef9b804f
Because mirroring is used by a container, you need to delete the container first, and then execute the delete command

docker rm 8f10ef9b804f

docker rmi $(docker images | grep "none" | awk '{print $3}')

Docker 19.03 for July 2019 has been officially released, and for me there are two highlights of this release.
1, is the docker don’t need root access to start drinking run
2, is to support the GPU enhancements, we want to read in the docker nvidia graphics card no longer need extra install nvidia – docker
Verify GPU options:
docker run –help | grep -i gpus
Docker calls the GPU command:
docker run -it –rm –gpus all ubuntu /bin/bash
The training model
parameter — GPUS ID must be present, otherwise the GPU will not be used. ID refers to which GPU is used for training, and it refers to binding the container to the specified GPU for running
 
Refer to the blog: https://blog.csdn.net/byaa34616/article/details/100951724

When docker starts tomcat, the access port of the container displays 404, and the source server fails to find the representation of the target resource or is unwilling to disclose an existing one

Solution:
systemctl stop firewalld.
systemctl disable firewalld.
s>mctl disable firewalld.
systemctl disable firewalld.
systemctl disable firewalld.
systemctl disable firewalld.
systemctl disable firewalld.
systemctl disable firewalld If Tomcat is still inaccessible after the firewall is turned off, the webapps folder is empty
2. The problem of webapps folder is empty check the tomcat container ID

docker ps
enter tomcat container terminal
docker exec – it tomcat container ID/bin/bash
enter
CD webapps webapps folder
copy on a webapps directory. All files to the webapps directory under the dist
cp – r.. /webapps.dist/* ./

Docker starts the image and reports an error. Iptables failed: iptables — wait – t NAT – a docker – P TCP

Iptables failed: iptables –wait -t nat-a docker-p TCP –wait -t nat-a docker-p TCP
Yesterday afternoon Docker started RabbitMQ and reported an error. I checked a lot of information and could not get it right. Finally, Docker was restarted and solved.
in addition to pull the rabbitmq is take the web management interface with management, command to write

docker pull rabbitmq:management

At the beginning of the pull is wrong for a long time

[[email protected] etc]# docker images
REPOSITORY                                                TAG                 IMAGE ID            CREATED             SIZE
docker.io/rabbitmq                                        management          4af5c5534d00        6 days ago          180 MB
docker.io/rabbitmq                                        latest              86a895bb41d6        6 days ago          150 MB
docker.io/redis                                           latest              01a52b3b5cd1        13 days ago         98.2 MB

Only the first one is
with a Web administration interface

Docker load loading mirror message JSON no such file or directory error

1. Problem description, ordinary image export and load
Export: docker save-o gz_dockernlfsmorev2.0.tar gz_docker:morev2.0
No such file or directory :docker load-i gz_dockerlnfsmorev2.0.tar

At first, it was thought that tar was missing, but later, SHA added the password to eliminate this reason;
After searching on Baidu, most of the answers they gave were “save” versus “load export” and “import”. Failure to do so, however, will not solve the problem. Because I’m using save and load and it’s OK. So the solution was abandoned. If you look at the kernel: cat /proc/version, docker version: docker-v
Later I wondered if the Linux kernel version and Docker version were incompatible.
First: Ubuntu Series, Docker Version: Docker Version 18.06.1-CE, Build E68FC7A, Kernel: Linux Version 4.15.0-112- Generic ([email protected]) (GCC Version 5.4.0 20160609 (Ubuntu 5.4.0-6Ubuntu 1~16.04.12)) #113~16.04.1-Ubuntu SMP Fri Jul 10 04:37:08 UTC 2020
Docker version: Docker version 19.03.1, build 74B1E89E8A kernel: El7.x86_64 ([email protected]) (GCC Version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)) #1 SMP Tue Mar 31 23:36:51 UTC 2020
Linux version 3.10.0-1127.el7.x86_64 ([email protected]) (GCC version 4.8.5 20150623 (Red Hat 4.5.3-39) (GCC))
The first and second sets load OK, the problem is the third set; Then I suspected that the Docker version was too high, so I updated the third Docker to Docker version 18.06.1-CE. Results: However, it was not useful. Excluded version incompatibilities;
At the moment their state of mind to collapse, finally calm down, re-comb the train of thought; Open the road to change destiny against heaven;
mkdir mydocker
1.tar-zxvf gz_dockerlnfsmorev2.0.tar MyDocker
2. CD mydocker

3. tar-cvf gz_dockerlnfsmorev2.0.tar *

4. The docker load -i gz_dockerlnfsmorev2. 0. The tar
Until this problem is completely solved;
Note that when re-tar-cvf, be sure to compress the file in the current directory where it was extracted. Otherwise, no such file or directory will also be reported
 
 

Solution to the problem that listen TCP 0.0.0.0:3306: bind: address already in use port is occupied in Linux centos7

Problem description:
When installing the mysql container running docker in the host environment, the port is occupied

Reason analysis:
The port is occupied and cannot bind the address
Solutions:
netstat -nap look for port 3306 look at the pid that the program is running and find that it is actually occupied, remember the pid
netstat -nap | grep 3306

kill the process, here is kill 1107

Multi environment configuration of springboot under docker

1. Dockerfile build file defines parameters

FROM java:8
VOLUME ["/home/pdsstm/uploads/pdsfile"]
COPY pds-stm-management.jar /home/pds-stm/jar/pds-stm-management.jar
ENV CE=$CE
EXPOSE 31080
ENTRYPOINT [ "sh", "-c", "java  -Djava.security.egd=file:/dev/./urandom -jar /home/pds-stm/jar/pds-stm-management.jar --spring.profiles.active=$CE" ]

Define variable CE
2. Go to the folder to build the image

docker build -t pds-stm .

3. Run the image with parameters

docker run -d -p 38082:31080 --name pds-stm -e CE="test" -v /home/pds-stm/jar:/home/pds-stm/jar -v /home/pds-stm/logs:/logs  --restart=always pds-stm

 

Docker machine install syntax error near unexpected token ‘newline’! DOCTYPE HTML problem resolution

Recently learned that the host management docker – machine this chapter, https://blog.csdn.net/CloudMan6/article/details/75810234 according to the article to learn,
To recommend a lot on learning docker website at https://github.com/llitfkitfk/docker-tutorial-cn
System: Ubuntu 14.04
Docker: 18.06.0 – ce
There was a problem with the installation and the command was as follows:

The curl -l https://github.com/docker/machine/releases/download/v0.9.0/docker-machine- ` ` uname – s – ` uname -m ` & gt; /tmp/docker-machine & &
chmod +x /tmp/docker-machine & &
sudo cp /tmp/docker-machine /usr/local/bin/docker-machine

His version was a little old, so I just changed v0.14.0 without considering anything else. The installation process is as follows. I was ordered to execute three separate orders,

The docker-machine file appears in the /usr/local/bin directory
View the version information to verify that the installation was successful. Run the command Docker-Machine version and find an error

When I look at the contents of the file, I see no problem. I suspect it’s A newline. Cat-a filename finds that the newline is $.
Also tried running the %s/^M//g command with the ^M tail removed. It could also be ‘< > ‘, but the HTML5 header can’t be deleted.

I found a way to install the website. No matter what I learn, I like the documents on the official website very much, because he is the most formal.
https://docs.docker.com/machine/install-machine/
If you are running on Linux:

$base=https://github.com/docker/machine/releases/download/v0.14.0 & amp; &
curl -L $base/docker-machine-$(uname -s)-$(uname -m) > /tmp/docker-machine & &
sudo install/TMP /docker-machine /usr/local/bin/docker-machine

I still have three commands to run, either replacing $bash with the url above, or simply accessing and pasting it directly in the host browser.
The installation process is as follows. Unlike above, it takes a little time and looks a lot more obvious.

Then it was time to witness the miracle. That’s it. I’ve finally installed it.

If you look at the files in /usr/local/bin, the contents are different. I’m finally ready to move on.

 
 

Frequently asked questions about docker

FAQ: 1, Cannot connect to the Docker daemon. Is the Docker daemon running on this host?Solution: This is the most common problem with docker when it’s first installed. There are two standard ways to solve this problem: A, start the Docker background service with root authority, and Service Docker Start. B, or add the current user to the Docker group. Apart from these two reasons, Docker daemon could not start, but more because the system boot time was wrong. Because the Gentoo kernel is self-defined, the majority of error reporting may be caused by parameter configuration in the kernel. Check /var/log/docker.log for any errors.
Error starting Daemon: Devices CGroup isn’t mounted in the kernel of Gentoo. It is required to open the cGroup, such as memory CFS RT, etc. For the BLkio error of cGroup, it needs to be turned on through the Settings inside the block.
3, Can’t Initialize iptables table ‘NAT ‘: Table does not Exist solution: Because iptables is the dependent component required to run for Docker (security Settings are required), it is crucial to set up the iptable correctly. If NAT is wrong when Docker starts, there are usually two reasons. The first reason is that iptables is not set correctly, and the second reason is the kernel setting. The standard iptables setup sequence is as follows: Iptables -F Service IPtables Save Service Iptables Restart has Gentoo installed and configured properly and should theoretically have an IPtable and NAT side. If the IPtables or NAT Settings are not correct, there is a problem with the kernel configuration. In kernel configuration, to activate IPtable and NAT, it is necessary to open netFilter and all the following functions in the network. Otherwise, at runtime, you’ll get all sorts of weird bugs. After the compilation core is restarted, the problem is resolved.
4, Error starting daemon: error initializing graphdriver: devmapper: Base Device UUID and F ilesystem verification failed: devicemapper: Error running deviceCreate (ActivateDevice) dm_task_run failed, fault analysis, the causes of the failure of several, one is the docker storage space is full, the new add or modify the container will be an Error, another reason is more direct,/var/log/docker/under the devicemapper data and metadata file is deleted. But the bottom line is that the uUID of the existing Storage-set is inconsistent with the UUID saved in the Docker configuration. Solution: The solution to this problem is simple and brutal. Clean all the configuration files of Docker directly (all the existing data will be lost), restart the service, and let Docker rebuild automatically. rm -rf /var/lib/docker/* service docker restart
 
Copyright belongs to the author. Please contact the author for any reprint.
the author: keenshoes (from douban)
source: https://www.douban.com/note/636127425/

How to Fix ERROR Couldn’t connect to Docker daemon at http+docker://localunixsocket

Ubuntu16.04 executes docker in the directory where the docker-compose. Yml file is located after installing docker:

[email protected]:/tmp/docker$ docker-compose up -d

Error:

ERROR: Couldn’t connect to Docker Daemon at HTTP + Docker :// localunixSock-is it running?
If it’s at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

Online all kinds of way seven eight bad solution, really ridicule.
What is correct is to add the current user to the Docker group

[email protected]:/tmp/docker$ sudo gpasswd -a ${USER} docker

Then exit the current user and switch to, say, root and then switch to Jing again. Then execute Docker-Compose up-D and it will be ok.

[email protected]:/tmp/docker$ sudo su
[email protected]:/tmp/docker$ su jing
[email protected]:/tmp/docker$ docker-compose up -d