|
|
Error response from daemon: mount /opt/jumpserver/config/mariadb/mariadb.cnf:/var/lib/docker/overlay2/a0ecacd1f734d4729dda971531bd0f26f35260724ae2a2cf1328e2c06822ad28/merged/etc/mysql/mariadb.cnf, flags: 0x5000: not a directory- Q+ l: l9 p8 _ w$ _: Q8 e
4 K$ d% e" ~$ s b r* y. M
提示报错:9 R" U3 {( r( {* g% G8 z+ [
无法docker cp 容器里的文件到操作系统中:
: e7 r) L1 W, C3 E" p& |docker cp jms_mysql:/tmp/jumpserver.sql /tmp/
: _7 E% A. K( ~$ R1 pError response from daemon: mount /opt/jumpserver/config/mariadb/mariadb.cnf:/var/lib/docker/overlay2/a0ecacd1f734d4729dda971531bd0f26f35260724ae2a2cf1328e2c06822ad28/merged/etc/mysql/mariadb.cnf, flags: 0x5000: not a directory2 q) N* m3 f% y
1 Q" t0 L3 D; m9 i5 c
3 K& L& g/ u l J5 u解决办法就是
7 p& R9 \5 ^8 ucd /opt/jumpserver/config/mariadb/
]2 }8 \: {3 F$ _( ` cd /opt/jumpserver/config/mariadb/0 u" K; t1 V" o& r
[root@localhost mariadb]# ls
2 q6 T5 f. p8 O- _$ A; x& n# Lmariadb.cnf 0 n' i* G) G+ p' q$ @5 O4 q
[root@localhost mariadb]# ls1 c. r8 L) @0 J; C2 o. \7 R
mariadb.cnf : O- C# w/ w+ q: W5 L' E
- t% x7 A$ [1 r4 [) O# H& ] [root@localhost mariadb]#rm -rf mariadb.cnf
( r g8 R# ?2 F4 F6 A! @& E. U
# [) b! W! a3 |5 \4 D" _, p k创建一个mariadb.cnf文件
/ @7 w1 A( P# f8 a: e3 P# {
& R! `) t( ~! F' z$ k* p5 g/ kvim mariadb.cnf% v, h% u1 m8 g
$ Z8 q' `' x. ]- V" U# The MariaDB configuration file
/ y( B2 Q3 }- c3 Y) F8 r& z#1 d% E Y" C+ E$ X
# The MariaDB/MySQL tools read configuration files in the following order:
/ |% j: l7 x8 k3 n* T# 0. "/etc/mysql/my.cnf" symlinks to this file, reason why all the rest is read.
5 H6 H8 k4 f. p9 m# Q4 j/ y# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults,. o* q- M" R* p4 s
# 2. "/etc/mysql/conf.d/*.cnf" to set global options.0 a! s# N6 z6 u8 {& v
# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.* f5 ^+ w2 R$ B7 M/ h
# 4. "~/.my.cnf" to set user-specific options.7 T/ G7 f d) Y+ ~" H5 E- H; g
#
& ~0 {. y/ d, c4 p% W( R B# If the same option is defined multiple times, the last one will apply.
. P c! J% }( w3 b: l8 | ~& D#' E; g9 w! ~" ~9 f# q' N
# One can use all long options that the program supports.8 p3 I) U$ D: w, |4 G
# Run program with --help to get a list of available options and with# e# r( K* b3 g+ l0 v
# --print-defaults to see which it would actually understand and use.8 `% E4 D: i. n* e7 K7 r
#
3 I4 t7 P) I/ Z8 c& D# If you are new to MariaDB, check out https://mariadb.com/kb/en/basic-mariadb-articles/4 v$ M! m+ \: ]# ~
( a+ ]0 u& l+ M; X4 {1 L#, z3 ^" |* z$ K3 _
# This group is read both by the client and the server! i3 s! E6 L' W O( `) g8 D
# use it for options that affect everything4 m4 h" [7 V7 k" f
#5 n4 O W0 \' z8 z( y
[client-server]
" f: `. t6 K4 N, ?# Port or socket location where to connect
5 d f+ ^# ^+ v7 U) V# s8 A+ Q! n# port = 3306
* s2 G9 I" V/ d& L; B" _socket = /run/mysqld/mysqld.sock
" y4 Z S& k1 _) K
# \9 r6 z C, e# Import all .cnf files from configuration directory: D) L* n1 S8 D s8 g
[mariadbd]
+ C$ O; l9 ?# N X- C m6 ^1 nskip-host-cache
% P1 {4 S: B4 O0 n& S7 {skip-name-resolve
8 `% R0 a8 T, v$ V2 T1 }2 g& `
6 P6 X% R2 q& t4 c0 X8 k!includedir /etc/mysql/mariadb.conf.d/
( h' J) `) j* W7 ~+ m!includedir /etc/mysql/conf.d/) T- q# v/ J2 i2 `
# O0 O( p5 L% A: K& H: i% Q7 Y$ z
8 n- C, {) o3 V1 a( I1 Z保存退出就可以解决问题。- Y( W) R% K# \
再次docker cp就可以正常复制了。
6 u) `6 x9 p( M4 c6 M! P# m5 x/ h q: D7 o6 I. ?1 u* r
[root@localhost mariadb]# docker cp jms_mysql:/tmp/jumpserver.sql /tmp/, @$ a, B+ ~* C" j! X& V" _" F0 w- y7 a
Successfully copied 2.96MB to /tmp/ P) S4 p. @* P1 v% k( _; y
& c2 T) z0 O H! F! N+ z
7 Q5 V B; Z1 C4 S+ `完美解决。1 D# p: n4 ?; W* w
7 t' l* G2 N* g4 f) T; g, Z" C
" ?. X$ ^, q7 p% g# U& e0 X) f' G! u$ B# N/ U: c
: s; E& R9 x! Q( {+ [ |
|