To verify the docker container contract awarding, the host machine receiving process, the udp contract awarding program was written in C, use on the host
1, GCC syslogclient_c. C - o syslogclient_c generated executable files; Run the executable verification through,
2, start a docker container, through docker cp syslogclient_c dockername:
in the/home3, the docker exec into the docker container, copy to the Home directory view syslogclientc_c has success;
4, docker container into the Home directory,/syslogclient_c running executable files, get tips:
Bash:./syslogclient_c: No to the file or directory
Analysis the reason, at first thought it was a permission problem, chmod 777 syslogclient_c before execution, still submitted to
The same mistake, the Internet search, see others say no files under/usr/bin, the copy files to/usr/bin to execute,
Still at same error; Referred to in the "https://blog.csdn.net/RonnyJiang/article/details/70738260" 32-bit and 64 - bit problem, in their own system execution on a host computer uname -a
Linux workcomputer 5.0.0-32 - generic # 34 - Ubuntu SMP Wed Oct 2 02:06:48 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
In the container to perform uname -a:
Linux a0d056ac57e3 5.0.0-32 - generic # 34-2019 x86_64 Linux Ubuntu SMP Wed Oct 2 02:06:48 UTC
All is a 64 - bit. There is no difference, put mentioned in the reference check my file using the file information, also use the file in his computer to check executable files
The file syslogclient_c
Syslogclient_c: ELF 64 - bit LSB Shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter/lib64/ld - Linux - x86-64. So. 2, BuildID [sha1]=0361 d51a8a0f0f01ea42865b816a00a012823f9a, for GNU/Linux 3.2.0, not stripped
See "dynamically linked", associated with its own docker container haven't install GCC, etc., should be the dynamic libraries to connect the reason,
Validation:
Using GCC on a host computer - static way static connection, and then copy to the docker container, success!!!!!! Thank RonnyJiang posts,