Tag Archives: docker

[Solved] Docker ubuntu swoole fatal error: openssl/ssl.h: No such file or directory

Dockerfile

RUN apt-get update -y
RUN apt-get install -y libssl-dev
RUN cd /tmp/ && rm -rf ./swoole-src
&& curl -o ./swoole.tar.gz https://github.com/swoole/swoole-src/archive/master.tar.gz -L
&& tar zxvf ./swoole.tar.gz
&& mv swoole-src* swoole-src
&& cd swoole-src
&& phpize
&& ./configure –enable-openssl –with-openssl-dir=/usr/lib/ssl –enable-http2
&& make && make install
&& docker-php-ext-enable swoole

Although openssl has been installed, but the corresponding libs are missing, looking for half a day to know the need to install libssl-dev (centos is openssl-devel)

openssl version -a

[Solved] ERROR: for jms_koko Cannot start service koko: driver failed programming

ERROR: for jms_koko Cannot start service koko: driver failed programming
error:

jms_mysql is up-to-date
jms_redis is up-to-date
Creating jms_core ... done
Creating jms_guacamole ... 
Creating jms_celery    ... 
Creating jms_koko      ... 
Creating jms_koko      ... error
Creating jms_luna      ... 
WARNING: Host is already in use by another container

ERROR: for jms_koko  Cannot start service koko: driver failed programming externCreating jms_guacamole ... done
Creating jms_celery    ... done
tcp -d 0/0 --dport 2222 -j DNAT --to-destination 192.168.250.5:2222 ! -i br-c11eCreating jms_lina      ... done
Creating jms_luna      ... done

ERROR: for koko  Cannot start service koko: driver failed programming external connectivity on endpoint jms_koko (741a5fd6b1e317171d1ed6ac21bbf5b97d7035ca33b1bc9bc721e4e864843942):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 2222 -j DNAT --to-destination 192.168.250.5:2222 ! -i br-c11e31f24830: iptables: No chain/target/match by that name.
 (exit status 1))
ERROR: Encountered errors while bringing up the project.

The custom chain docker defined when docker service is started is cleared due to centos7 firewall
solution

#systemctl restart docker// restart docker server

Then run jump server

ERROR: for nginx Container “xxx” is unhealthy.

Error information

ERROR: for nginx Container "5b4004998a86" is unhealthy. 

resolvent

#docker logs -f jms_core --tail 200 

Jenkins docker push to harbor to report error

Jenkins docker push to harbor private service error solution

Jenkins reported an error

When using docker push to private service in jenkinsfile, an error is reported. The error information is as follows:

unauthorized: unauthorized to access repository: ocp/eureka-server, action: push: unauthorized to access repository: ocp/eureka-server, action: push

This is because Jenkins uses the pseudo user of Jenkins when pushing the image. Since you need to log in to push, you should first generate config.json in the current user

The current user uses docker login to generate config.json

The current user logs in with the following command

docker login ip:port

After entering the user name and you, a config.json file is generated in the. Docker directory of the current user’s root directory, as follows:

[[email protected] ~]$ cat /root/.docker/config.json 
{
        "auths": {
                "harbor.aiuyo.com:643": {
                        "auth": "d2FuZ3hpYW5mZW5nOlhpYW5mZW5nOTk="
                }
        }
}

Copy. Docker to/var/lib/Jenkins directory

    after logging in with root, copy the/user name /. Docker/directory to/var/lib/Jenkins, and modify the folder permission chown – R Jenkins. Jenkins. Docker to/var/lib/Jenkins

     

    cp -r /root/.docker/ /var/lib/jenkins/
    cd /var/lib/jenkins/
    chown -R jenkins.jenkins .docker

    I am for this reason. After modification, it can be pushed

[Solved] com.alibaba.druid.pool.DruidDataSource – create connecti

A service deployed in the server docker reported the following error when connecting to the database:

I have searched a lot of information on the Internet, but I can’t solve it by trying various ways,
ERROR com.alibaba.druid.pool.DruidDataSource - create connection SQLException, url: jdbc:mysql://10.10.20.16:3306/acs?&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=Asia/Kolkata, errorCode 0, state 08S01
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

The specific error information is as follows:

ERROR com.alibaba.druid.pool.DruidDataSource – create connection SQLException, url: jdbc:mysql ://10.10.20.16:3306/acs?& amp; useUnicode=true& characterEncoding=UTF-8& zeroDateTimeBehavior=convertToNull& allowMultiQueries=true& serverTimezone=Asia/Kolkata, errorCode 0, state 08S01
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

Cause of error:

It may be due to the different versions of JDK. This error message is probably caused by the SSL protocol of MySQL

solution: I tried to remove SSLv3 from java.security in jdk-8 on my local machine and restart the service, but I still couldn’t solve it
finally, add this to the MySQL connection string in the service configuration; Usessl = false, that is, disable SSL, problem solved

Docker run Error: container_linux.go:235: starting container process caused “process_linux.go:258: appl

Error message:
container_ linux.go:235: starting container process caused “process_ linux.go:258: applying cgroup configuration for process caused “Cannot set property TasksAccounting, or unknown property.””
/usr/bin/docker-current: Error response from daemon: oci runtime error: container_ linux.go:235: starting container process caused “process_ linux.go:258: applying cgroup configuration for process caused “Cannot set property TasksAccounting, or unknown prop
After the system is rebooted, the docker cannot be started. After the docker is reloaded, the startup container will report an error, as shown above

reason:

The docker version is not compatible with the operating system version. Upgrade the docker version
I use Yum to install docker. By default, I can only pull to a lower version, so I downloaded RPM docker from the Internet.

The solution to the crash loop back off error of coredns in k8s deployment

The solution to the crash loop back off error of coredns in k8s deployment

Problem description

Before doing the project, we need to use k8s to build a cluster. I’m a novice Xiaobai, and I’m going to do it step by step according to the online building steps (refer to the link website for the deployment process)
when I check the status of each pod in the cluster, I find that coredns has not been started successfully, and has been in the crashloopback off state, falling into the dead cycle of non-stop error restart

[[email protected] a1zMC2]# kubectl get pods -n kube-system
NAME                                 READY   STATUS             RESTARTS   AGE
coredns-bccdc95cf-9wd9n              0/1     CrashLoopBackOff   19         19h
coredns-bccdc95cf-qsf9f              0/1     CrashLoopBackOff   19         19h
etcd-k8s-master                      1/1     Running            3          19h
kube-apiserver-k8s-master            1/1     Running            3          19h
kube-controller-manager-k8s-master   1/1     Running            11         19h
kube-flannel-ds-amd64-sgqsm          1/1     Running            1          16h
kube-flannel-ds-amd64-swqhf          1/1     Running            1          16h
kube-flannel-ds-amd64-tnbmc          1/1     Running            1          16h
kube-proxy-259l8                     1/1     Running            0          16h
kube-proxy-qcnpt                     1/1     Running            0          16h
kube-proxy-rp7qx                     1/1     Running            3          19h
kube-scheduler-k8s-master            1/1     Running            11         19h

Solutions

Check the log file of coredns. The content is as follows

[[email protected] a1zMC2]# kubectl logs -f coredns-bccdc95cf-9wd9n -n kube-system
E0512 01:59:03.825489       1 reflector.go:134] github.com/coredns/coredns/plugin/kubernetes/controller.go:317: Failed to list *v1.Endpoints: Get https://10.96.0.1:443/api/v1/endpoints?limit=500&resourceVersion=0: dial tcp 10.96.0.1:443: connect: no route to host
E0512 01:59:03.825489       1 reflector.go:134] github.com/coredns/coredns/plugin/kubernetes/controller.go:317: Failed to list *v1.Endpoints: Get https://10.96.0.1:443/api/v1/endpoints?limit=500&resourceVersion=0: dial tcp 10.96.0.1:443: connect: no route to host
log: exiting because of error: log: cannot create log: open /tmp/coredns.coredns-bccdc95cf-9wd9n.unknownuser.log.ERROR.20210512-015903.1: no such file or directory

再通过kubectl describe pod coredns-bccdc95cf-9wd9n -n kube-system命令查看详情

Events:
  Type     Reason            Age                  From                 Message
  ----     ------            ----                 ----                 -------
  Warning  FailedScheduling  16h (x697 over 17h)  default-scheduler    0/1 nodes are available: 1 node(s) had taints that the pod didn't tolerate.
  Warning  Unhealthy         15h (x5 over 15h)    kubelet, k8s-master  Readiness probe failed: Get http://10.244.0.2:8080/health: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
  Warning  Unhealthy         15h (x5 over 15h)    kubelet, k8s-master  Liveness probe failed: Get http://10.244.0.2:8080/health: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

I feel that there should be a problem connecting with the host, so I enter cat/etc/resolv. Conf to view the configuration file. It is found that the nameserver column is not the address of the host master.

With a try attitude, modify it to the IP address of the master node, and then restart docker and kubenet

[[email protected] a1zMC2]# systemctl stop kubelet
[[email protected] a1zMC2]# systemctl stop docker
[[email protected] a1zMC2]# iptables --flush
[[email protected] a1zMC2]# iptables -tnat --flush
[[email protected] a1zMC2]# systemctl start kubelet
[[email protected] a1zMC2]# systemctl start docker

Check the status and find that all pods can work normally!

[[email protected] a1zMC2]# kubectl get pods -n kube-system
NAME                                 READY   STATUS    RESTARTS   AGE
coredns-bccdc95cf-9wd9n              1/1     Running   21         20h
coredns-bccdc95cf-qsf9f              1/1     Running   21         20h
etcd-k8s-master                      1/1     Running   4          19h
kube-apiserver-k8s-master            1/1     Running   4          19h
kube-controller-manager-k8s-master   1/1     Running   12         19h
kube-flannel-ds-amd64-sgqsm          1/1     Running   1          17h
kube-flannel-ds-amd64-swqhf          1/1     Running   1          17h
kube-flannel-ds-amd64-tnbmc          1/1     Running   2          17h
kube-proxy-259l8                     1/1     Running   0          17h
kube-proxy-qcnpt                     1/1     Running   0          17h
kube-proxy-rp7qx                     1/1     Running   4          20h
kube-scheduler-k8s-master            1/1     Running   12         19h

Because I haven’t learned the content of cloud computing, there are some mistakes in the blog. Please correct them in the comments area.

Docker Startup Error: standard_init_linux.go:211: exec user process caused “no such file or directory”

As shown in the question, start the Docker container according to the image built by yourself, exit directly, and check the error message in the container log without any other information. Internet search this problem, found that many people have encountered, the solution is also different, finally found an article. Inspired, my project is a Java project that builds a service running in the background with the ENTRYPOINT command starting the script docker-entrypoint.sh. My Docker-entrypoint. sh is edited under Windows, and the natural FileFormat is DOS. Here, it needs to be modified to Unix, and the modification method is also very simple. There is no need to operate under Linux.

After the modification is completed, the image can be built again. If the new image is started, no error will be reported, which is usually difficult to detect. I hereby record it, hoping to help someone who has encountered this mistake.

[environment] docker: error response from daemon: OCI runtime

Background

When the compiled image is exported and loaded into another computer, the error is as follows:

//import mirror
docker import example.tar

//run the docker
docker run -it example:v20210119 /bin/bash

//error:
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: 
starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown.

For the description of this problem, there are probably two kinds of factional explanations on the Internet under Google

Left wing school

There is no/bin/bash in production, try/bin/sh, the result is still the problem

Right wing

Compatibility between Linux and docker. Then uninstall the old version and install the latest one.

The solution of the left faction is very easy to verify. After repeated verification, the problem is still unsolved. It is commonly known as the left faction.

The solution of the right faction is a bit difficult to verify, but intuition tells me that it should not be such a problem

Sure enough, I saw the right answer. After a careful look, a short description and a quick verification, the problem was solved.

this error occurs when docker runs. It is caused by different ways of saving the image. If the image is imported by using import, it should be noted that import can import the image package saved by save and the container package saved by export. However, if the image package saved by save is imported, there is no error. But this error occurs when run runs

    1. solutions
docker load < buildroot_v20210119.tar

docker.errors.DockerException: Error while fetching server API version: (‘Connection aborted.‘, File

Problem description

ocker.errors.DockerException: Error while fetching server API version: (‘Connection aborted.’, FileNotFoundError(2, ‘No such file or directory’))

Causes

The reason is that docker did not start

terms of settlement

Open docker:

systemctl start docker

Look at docker process

ps -ef | grep docker

Final execution

docker-compose up -d

The drone settings page is not trusted

The drone settings page is not trusted

In the tutorial of building the drone cicd system, check trusted in the main part of settings. The normal page is like this

If you don’t have a trusted page, like this

It means that the user who logs in to drone is not an administrator, so you can’t see the option of trusted.

Solution

Check if there is drone in the docker running parameter of drone_ USER_ Create , as shown in the figure below

docker run \
  --volume=/opt/bin/drone/data:/data \
  --env=DRONE_GIT_ALWAYS_AUTH=true \
  --env=DRONE_GIT_USERNAME=xxx \
  --env=DRONE_GIT_PASSWORD=xxx \
  --env=DRONE_GOGS=true \
  --env=DRONE_GOGS_SKIP_VERIFY=false \
  --env=DRONE_GOGS_SERVER=http://xxx \
  --env=DRONE_PROVIDER=gogs \
  --env=DRONE_RPC_SECRET=xxx \
  --env=DRONE_USER_CREATE=username:yourUsername,admin:true \
  --env=DRONE_SERVER_PROTO=http \
  --publish=xxx:80 \
  --publish=xxx:443 \
  --restart=always \
  --detach=true \
  --name=drone \
  -h drone \
  drone/drone:1

--env=DRONE_ USER_ CREATE= username:yourUsername , admin:true this line is very important. After that, you can log in to drone with your user name and become an administrator. If you don’t add it, you won’t see the trusted button.

At that time, the -- env in my line was written as - env which resulted in that the parameters in this line did not take effect and that I did not run drone as an administrator, so I could not see the option of trusted.

Others: how to restart drone after it has been run?

docker rm -f drone # Delete the original image
# Run the above docker run to build a new image and run it

Docker mysql8 modify password

Docker mysql8 modify password

Set skip password login

docker exec -it mysql /bin/sh
# Note: The configuration file for editing is docker.cnf
vi /etc/mysql/conf.d/docker.cnf
exit

Restart MySQL container

docker restart mysql

Restart MySQL container

The old version of the command is invalid:
update user set password = password (‘a123456 ‘), where user =’root'</ s>
correct:

UPDATE mysql.user SET authentication_string='' WHERE user='root' and host='localhost';
-- Change the password for use without expiration
ALTER USER 'root'@'%' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; 
flush privileges;

Error handling

ERROR 2059 (HY000): Authentication plugin ‘caching_ sha2_ password’ cannot be loaded: /usr/lib64/mysql/plugin/caching_ sha2_ password.so: cannot open shared object file: No such file or directory

Maybe the password is not set and will never expire. Maybe the database client version under Linux is too low. I tried to connect to mysql8 of docker in server B on server a, but the connection was successful by using DataGrid in windows.

Creating users and authorizations

create user  'nacos'@'%' identified by '123';
grant all on mid_nacos.* to 'nacos'@'localhost' ;
flush privileges;

Here, all the permissions of the table are granted, and all the items that can be authorized are explained and referenced https://www.cnblogs.com/yinzhengjie/p/10263692.html

Solve the error of operation create user failed for ‘user’ @ ‘%

It may be that the user already exists, you can delete and recreate it to
check whether the user exists: select user from user
delete: drop user 'user' @ '%

Solving com.mysql.cj.exceptions.unabletoconnectexception: public key retrieval is not allowed

Add & amp; after the connection information; allowPublicKeyRetrieval=true

[extremely simple and effective] installing docker under centos6. X

1. Upgrade Linux kernel

    rpm –import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

 

    rpm -Uvh http://www.elrepo.org/elrepo-release-6-8.el6.elrepo.noarch.rpm     

 

    yum –enablerepo=elrepo-kernel install kernel-lt -y

2. Modify default startup order

   vim /etc/ grub.conf

Restart the server

shutdown -r now

3. Disable SELinux

4. Offline installation of docker with static binary files

reference resources https://docs.docker.com/install/linux/docker-ce/binaries/#install -static-binaries

This installation method is the most simple and correct, the rest of the online reference rpm, yum installation all have a variety of problems.

 

1. Download static binary file

go to https://download.docker.com/linux/static/stable/ (or change stable to edge or test), select your hardware platform, and then download. Tgz files related to the docker CE version to be installed.

 

2. Decompress

$ tar –xzvf docker-18.06.3- ce.tgz For this, please install it on demand

Required: move the binary file to a directory on the executable path, such as/usr/bin /.

——–Without this step, it is invalid to call docker under the docker file

$ sudo cp docker/* /usr/bin/

3. Start the docker daemon:

$ sudo dockerd&

Note: if the following error occurs when starting the daemons:

The reason is that CGroup is not mounted on the host computer. To add a mount, the solution is as follows:

vim /etc/fstab

none        /sys/fs/cgroup        cgroup        defaults    0    0

Save and restart.

4. Start the docker command test

docker -v