Docker verstehen

Diskutiere Docker verstehen im Deployment Bereich.
mihe7

mihe7

Ich hatte ein Screenshot aus einer veralteten Konfigurationsdatei erstellt.
Die entsprechende Datasource Url lautet
Aha.

Ich denke das kann ausgeschlossen werde, da wenn ich den originalen Container nochmal starte (docker start ID) gibt es keine Probleme.
OK. Wenn der neue Container mit gleichem Hostnamen im gleichen Netz platziert wird, sehe ich keinen Grund, warum das nicht funktionieren sollte... Schau mal mit docker logs nach, ob Du der Exception mehr Info entnehmen kannst.
 
J

JUUNND

Hmm ich glaube so langsam kommen wir der Sache näher...Zumindest konnte ich hier bei den Logs Abweichungen zwischen dem funktionierenden Container und dem fehlerhaften Containers feststellen. Hier mal ein Ausschnitt aus den Logs der glaube ich ganz interessant ist.
Ich habe im Anhang die kompletten Logs mal vorsichtshalber beigefügt.

Funktionierender Container
2020-04-06T09:55:50.946353Z 0 [Note] mysqld: ready for connections.
Version: '5.7.29' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server (GPL)
2020-04-06 09:55:51+00:00 [Note] [Entrypoint]: Temporary server started.
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.

020-04-06 09:55:55+00:00 [Note] [Entrypoint]: Creating database db
2020-04-06 09:55:55+00:00 [Note] [Entrypoint]: Creating user root
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'root'@'%'
2020-04-06 09:55:56+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.29-1debian10 started.
2020-04-06 09:55:56+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2020-04-06 09:55:56+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.29-1debian10 started.
2020-04-06T09:55:57.244937Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-04-06T09:55:57.247437Z 0 [Note] mysqld (mysqld 5.7.29) starting as process 1 ...

2020-04-06T09:55:57.253878Z 0 [Note] InnoDB: PUNCH HOLE support available
2020-04-06T09:55:57.254273Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-04-06T09:55:57.254561Z 0 [Note] InnoDB: Uses event mutexes
2020-04-06T09:55:57.254788Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2020-04-06T09:55:57.255161Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-04-06T09:55:57.255459Z 0 [Note] InnoDB: Using Linux native AIO
2020-04-06T09:55:57.256246Z 0 [Note] InnoDB: Number of pools: 1
2020-04-06T09:55:57.256722Z 0 [Note] InnoDB: Using CPU crc32 instructions
2020-04-06T09:55:57.259792Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-04-06T09:55:57.278234Z 0 [Note] InnoDB: Completed initialization of buffer pool
2020-04-06T09:55:57.287625Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-04-06T09:55:57.367708Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2020-04-06T09:55:57.372278Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 2629932
2020-04-06T09:55:57.717154Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 7872512
2020-04-06T09:55:58.024249Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 12480217
2020-04-06T09:55:58.025781Z 0 [Note] InnoDB: Database was not shutdown normally!
2020-04-06T09:55:58.025813Z 0 [Note] InnoDB: Starting crash recovery.
2020-04-06T09:55:58.059104Z 0 [Note] InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percent: 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
2020-04-06T09:55:58.974321Z 0 [Note] InnoDB: Apply batch completed
2020-04-06T09:55:59.088451Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2020-04-06T09:55:59.088581Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-04-06T09:55:59.088775Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-04-06T09:55:59.203436Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-04-06T09:55:59.206058Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2020-04-06T09:55:59.206124Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2020-04-06T09:55:59.215656Z 0 [Note] InnoDB: 5.7.29 started; log sequence number 12480217
2020-04-06T09:55:59.216691Z 0 [Note] Plugin 'FEDERATED' is disabled.
2020-04-06T09:55:59.236413Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-04-06T09:55:59.238439Z 0 [Note] InnoDB: Buffer pool(s) load completed at 200406 9:55:59
2020-04-06T09:55:59.303814Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2020-04-06T09:55:59.304100Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2020-04-06T09:55:59.305371Z 0 [Warning] CA certificate ca.pem is self signed.
2020-04-06T09:55:59.308333Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2020-04-06T09:55:59.309771Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2020-04-06T09:55:59.311854Z 0 [Note] IPv6 is available.
2020-04-06T09:55:59.313679Z 0 [Note] - '::' resolves to '::';
2020-04-06T09:55:59.314139Z 0 [Note] Server socket created on IP: '::'.
2020-04-06T09:55:59.323811Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2020-04-06T09:55:59.343494Z 0 [Note] Event Scheduler: Loaded 0 events
2020-04-06T09:55:59.349591Z 0 [Note] mysqld: ready for connections.
Version: '5.7.29' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
2020-04-06T10:02:37.343995Z 4 [Note] Access denied for user 'root'@'172.24.0.1' (using password: NO)
2020-04-06T10:02:58.898558Z 5 [Note] Access denied for user 'root'@'172.24.0.1' (using password: NO)
2020-04-06T10:02:59.207567Z 6 [Note] Access denied for user 'root'@'172.24.0.1' (using password: YES)
2020-04-06T10:07:35.177294Z 0 [Note] Giving 14 client threads a chance to die gracefully
2020-04-06T10:07:35.177391Z 0 [Note] Shutting down slave threads
2020-04-06T10:07:37.177817Z 0 [Note] Forcefully disconnecting 14 remaining clients
2020-04-06T10:07:37.178045Z 0 [Warning] mysqld: Forcing close of thread 18 user: 'root'

2020-04-06T10:07:37.178430Z 0 [Warning] mysqld: Forcing close of thread 3 user: 'root'

2020-04-06T10:07:37.178589Z 0 [Warning] mysqld: Forcing close of thread 2 user: 'root'

2020-04-06T10:07:37.178690Z 0 [Warning] mysqld: Forcing close of thread 8 user: 'root'

2020-04-06T10:07:37.178765Z 0 [Warning] mysqld: Forcing close of thread 7 user: 'root'

2020-04-06T10:07:37.178832Z 0 [Warning] mysqld: Forcing close of thread 9 user: 'root'

2020-04-06T10:07:37.178930Z 0 [Warning] mysqld: Forcing close of thread 10 user: 'root'

2020-04-06T10:07:37.182928Z 0 [Warning] mysqld: Forcing close of thread 11 user: 'root'

2020-04-06T10:07:37.183625Z 0 [Warning] mysqld: Forcing close of thread 13 user: 'root'

2020-04-06T10:07:37.183830Z 0 [Warning] mysqld: Forcing close of thread 12 user: 'root'

2020-04-06T10:07:37.184267Z 0 [Warning] mysqld: Forcing close of thread 15 user: 'root'

2020-04-06T10:07:37.184679Z 0 [Warning] mysqld: Forcing close of thread 14 user: 'root'

2020-04-06T10:07:37.184848Z 0 [Warning] mysqld: Forcing close of thread 16 user: 'root'

2020-04-06T10:07:37.184956Z 0 [Warning] mysqld: Forcing close of thread 17 user: 'root'
Fehlerhafter Container
020-04-06 17:25:39+00:00 [Note] [Entrypoint]: Temporary server started.
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.

2020-04-06 17:25:42+00:00 [Note] [Entrypoint]: Stopping temporary server
2020-04-06T17:25:42.197758Z 0 [Note] Giving 0 client threads a chance to die gracefully
2020-04-06T17:25:42.197836Z 0 [Note] Shutting down slave threads
2020-04-06T17:25:42.197843Z 0 [Note] Forcefully disconnecting 0 remaining clients
2020-04-06T17:25:42.197850Z 0 [Note] Event Scheduler: Purging the queue. 0 events
2020-04-06T17:25:42.197918Z 0 [Note] Binlog end

2020-04-06T17:25:42.198614Z 0 [Note] Shutting down plugin 'ngram'
2020-04-06T17:25:42.198656Z 0 [Note] Shutting down plugin 'partition'
2020-04-06T17:25:42.198664Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2020-04-06T17:25:42.198670Z 0 [Note] Shutting down plugin 'ARCHIVE'
2020-04-06T17:25:42.198673Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2020-04-06T17:25:42.198702Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2020-04-06T17:25:42.198707Z 0 [Note] Shutting down plugin 'MyISAM'
2020-04-06T17:25:42.198724Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2020-04-06T17:25:42.198729Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2020-04-06T17:25:42.198733Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2020-04-06T17:25:42.198737Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2020-04-06T17:25:42.198741Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2020-04-06T17:25:42.198744Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2020-04-06T17:25:42.198747Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2020-04-06T17:25:42.198751Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2020-04-06T17:25:42.198755Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2020-04-06T17:25:42.198758Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2020-04-06T17:25:42.198762Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2020-04-06T17:25:42.198766Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2020-04-06T17:25:42.198769Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2020-04-06T17:25:42.198774Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2020-04-06T17:25:42.198777Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2020-04-06T17:25:42.198805Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2020-04-06T17:25:42.198810Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2020-04-06T17:25:42.198813Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2020-04-06T17:25:42.198823Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2020-04-06T17:25:42.198834Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2020-04-06T17:25:42.198837Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2020-04-06T17:25:42.198841Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2020-04-06T17:25:42.198845Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2020-04-06T17:25:42.198848Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2020-04-06T17:25:42.198851Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2020-04-06T17:25:42.198854Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2020-04-06T17:25:42.198857Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2020-04-06T17:25:42.198860Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2020-04-06T17:25:42.198863Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2020-04-06T17:25:42.198866Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2020-04-06T17:25:42.198869Z 0 [Note] Shutting down plugin 'InnoDB'
2020-04-06T17:25:42.199121Z 0 [Note] InnoDB: FTS optimize thread exiting.
2020-04-06T17:25:42.199505Z 0 [Note] InnoDB: Starting shutdown...
2020-04-06T17:25:42.300125Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2020-04-06T17:25:42.300655Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 200406 17:25:42
2020-04-06T17:25:43.437628Z 0 [Note] InnoDB: Shutdown completed; log sequence number 12480689
2020-04-06T17:25:43.440763Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2020-04-06T17:25:43.440819Z 0 [Note] Shutting down plugin 'MEMORY'
2020-04-06T17:25:43.440827Z 0 [Note] Shutting down plugin 'CSV'
2020-04-06T17:25:43.440831Z 0 [Note] Shutting down plugin 'sha256_password'
2020-04-06T17:25:43.440833Z 0 [Note] Shutting down plugin 'mysql_native_password'
2020-04-06T17:25:43.441001Z 0 [Note] Shutting down plugin 'binlog'
2020-04-06T17:25:43.443959Z 0 [Note] mysqld: Shutdown complete

2020-04-06 17:25:44+00:00 [Note] [Entrypoint]: Temporary server stopped

2020-04-06 17:25:44+00:00 [Note] [Entrypoint]: MySQL init process done. Ready for start up.

2020-04-06T17:25:44.407705Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-04-06T17:25:44.409487Z 0 [Note] mysqld (mysqld 5.7.29) starting as process 1 ...
2020-04-06T17:25:44.413231Z 0 [Note] InnoDB: PUNCH HOLE support available
2020-04-06T17:25:44.413293Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-04-06T17:25:44.413301Z 0 [Note] InnoDB: Uses event mutexes
2020-04-06T17:25:44.413306Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2020-04-06T17:25:44.413310Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-04-06T17:25:44.413313Z 0 [Note] InnoDB: Using Linux native AIO
2020-04-06T17:25:44.413631Z 0 [Note] InnoDB: Number of pools: 1
2020-04-06T17:25:44.413811Z 0 [Note] InnoDB: Using CPU crc32 instructions
2020-04-06T17:25:44.415898Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-04-06T17:25:44.428980Z 0 [Note] InnoDB: Completed initialization of buffer pool
2020-04-06T17:25:44.431529Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-04-06T17:25:44.443898Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2020-04-06T17:25:44.479319Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-04-06T17:25:44.479722Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-04-06T17:25:44.495577Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-04-06T17:25:44.496285Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2020-04-06T17:25:44.496320Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2020-04-06T17:25:44.496687Z 0 [Note] InnoDB: Waiting for purge to start
2020-04-06T17:25:44.546988Z 0 [Note] InnoDB: 5.7.29 started; log sequence number 12480689
2020-04-06T17:25:44.547319Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-04-06T17:25:44.547325Z 0 [Note] Plugin 'FEDERATED' is disabled.
2020-04-06T17:25:44.551336Z 0 [Note] InnoDB: Buffer pool(s) load completed at 200406 17:25:44
2020-04-06T17:25:44.553966Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2020-04-06T17:25:44.554000Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2020-04-06T17:25:44.554540Z 0 [Warning] CA certificate ca.pem is self signed.
2020-04-06T17:25:44.554586Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2020-04-06T17:25:44.554989Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2020-04-06T17:25:44.555059Z 0 [Note] IPv6 is available.
2020-04-06T17:25:44.555070Z 0 [Note] - '::' resolves to '::';
2020-04-06T17:25:44.555093Z 0 [Note] Server socket created on IP: '::'.
2020-04-06T17:25:44.557763Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2020-04-06T17:25:44.566849Z 0 [Note] Event Scheduler: Loaded 0 events
2020-04-06T17:25:44.567070Z 0 [Note] mysqld: ready for connections.
Version: '5.7.29' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
2020-04-06T17:36:05.240038Z 0 [Note] Giving 5 client threads a chance to die gracefully
2020-04-06T17:36:05.240072Z 0 [Note] Shutting down slave threads
2020-04-06T17:36:07.240274Z 0 [Note] Forcefully disconnecting 5 remaining clients
2020-04-06T17:36:07.240323Z 0 [Warning] mysqld: Forcing close of thread 5 user: 'root'

2020-04-06T17:36:07.240394Z 0 [Warning] mysqld: Forcing close of thread 4 user: 'root'

2020-04-06T17:36:07.240414Z 0 [Warning] mysqld: Forcing close of thread 6 user: 'root'

2020-04-06T17:36:07.240431Z 0 [Warning] mysqld: Forcing close of thread 2 user: 'root'

2020-04-06T17:36:07.240442Z 0 [Warning] mysqld: Forcing close of thread 3 user: 'root'
Kannst du mir den Informationen was anfangen und weiß was zu tun ist ? Hatte mal versucht nach dem Starten des Containers die Berechtigungen anzupassen, möglicherweise gibt es da ja irgendeinen Zusammenhang. Hat aber nichts gebracht.

-> docker exec -it ID bin/bash
-> mysql -uroot -p
-> ALTER USER 'root' IDENTIFIED WITH mysql_native_password BY 'root';
-> GRANT ALL PRIVILEGES ON *.* TO 'root' WITH GRANT OPTION;
->FLUSH PRIVILEGES;
 

Anhänge

mihe7

mihe7

Ich meinte die Logs des SpringBoot-Containers :) (dort tritt ja die Exception auf).
 
J

JUUNND

Also ich habe mal mitgeloggt bei dem Versuch auf die ensprechende Ressource der Spring Boot Anwendung zuzugreifen. Dabei erhalte ich eine UnknownHostException.

7.PNG

Aus einem anderen Thread bei dem jemand ein ähnliches Problem hatte, konnte dies durch den Zusatz autoReconnect=true in der Spring URL gelöst werden. Bei mir hatte dies leider keine spürbare Auswirkung.

ich hatte jetzt jedoch gesehen, dass über docker inspect auch detaillierte Informationen über die Container angezeigt werden können. Das habe ich bei den MySql Containern (beim fehlerfreien und fehlerhaften) mal gemacht und mal stumpf verglichen. Ich habe mal die Zeilen wo es Abweichungen gibt (und wo ich denke, dass es dort keine Abweichungen geben darf oder ich mir nicht sicher war) fett markiert. Ich denke insb. die Binds in der Hostconfig und die Labels sind auffällig.
Da scheint wohl etwas nicht korrekt zu funktionieren. o_O
Was meinst du ?

Bei dem fehlerfreien Contaiern wird als Hostname die entsprechende Container ID verwendet. Das sollte aber glaube keinen Unterschied machen, oder ? Ich habe zumindest auf die Schnelle keine Möglichkeit gefunden um den Hostname während der Laufzeit auf die Container ID zu ändern um das mal zu testen.

Fehlerfhaft
[
{
"Id": "ea4e60e6f4ff62bdc52ac30dd2204d92daaf9c5d550c730d4a1791fb4dc85080",
"Created": "2020-04-06T21:45:37.165073469Z",
"Path": "docker-entrypoint.sh",
"Args": [
"mysqld"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 30716,
"ExitCode": 0,
"Error": "",
"StartedAt": "2020-04-06T21:45:37.511050369Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "sha256:413be204e9c34f31476a0680b6521873fb519c749693b181228ff47492a7fe3b",
"ResolvConfPath": "/var/lib/docker/containers/ea4e60e6f4ff62bdc52ac30dd2204d92daaf9c5d550c730d4a1791fb4dc85080/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/ea4e60e6f4ff62bdc52ac30dd2204d92daaf9c5d550c730d4a1791fb4dc85080/hostname",
"HostsPath": "/var/lib/docker/containers/ea4e60e6f4ff62bdc52ac30dd2204d92daaf9c5d550c730d4a1791fb4dc85080/hosts",
"LogPath": "/var/lib/docker/containers/ea4e60e6f4ff62bdc52ac30dd2204d92daaf9c5d550c730d4a1791fb4dc85080/ea4e60e6f4ff62bdc52ac30dd2204d92daaf9c5d550c730d4a1791fb4dc85080-json.log",
"Name": "/test_123",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": [
"623938104dc4bc9b14ab5c226c381918e69f4e7c06f981db643ffdfc78f889e3"
],
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "services_backend",
"PortBindings": {
"3306/tcp": [
{
"HostIp": "",
"HostPort": "3307"
}
]
},
"RestartPolicy": {
"Name": "always",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"Capabilities": null,
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "private",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"ConsoleSize": [
72,
271
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": [],
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": [],
"DeviceCgroupRules": null,
"DeviceRequests": null,
"KernelMemory": 0,
"KernelMemoryTCP": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": null,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": [
"/proc/asound",
"/proc/acpi",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware"
],
"ReadonlyPaths": [
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
]
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/2c86674adc5a83b6e3cfddf128be6ade85738a8de22f8037581b6c4488dc1d62-init/diff:/var/lib/docker/overlay2/77c7305c881cda49167258e446a4df085e067527bb55e1efdae1639a2329be3b/diff:/var/lib/docker/overlay2/ecb016976ce3bc3cbbd42ae0b74fa53b33a8bcb6a1fa5b4741b8ecd4744e3b75/diff:/var/lib/docker/overlay2/f278fac24e82264109668d5e4c4bff0d2278f7efb45957f775d255ec4424626b/diff:/var/lib/docker/overlay2/561f5c0dfec783f088ad8cc6b5045bd12bda04724a0c39d95fa92b5b5756a96b/diff:/var/lib/docker/overlay2/151ef8f7769fbe5658b5abaa4a518286e4fd59bab49a80e69ea553d45fa0cc0e/diff:/var/lib/docker/overlay2/9f6f0800ba1a74a15f4a45e606998d9dbaaa608771c2b2a49c4097eca194d544/diff:/var/lib/docker/overlay2/e45692697084e45633a3f3d4300d2773a4c79fd7d62720d340fdf2466335129d/diff:/var/lib/docker/overlay2/f2f42ec1d44be2bd8565bed1ac26e307699f1e73b216a33725a137c9e08b7a0c/diff:/var/lib/docker/overlay2/a6a5efd0088263338b9aff398e6174dbdb89133b02fe16478a398d8926214b15/diff:/var/lib/docker/overlay2/75a186835637d294e7409a958754f58d39efa9acf49e416d24d8fbc7ca4b4af2/diff:/var/lib/docker/overlay2/7ed146c4897b4e5b9b4edff2f5220f3839ca13fd5d9e62eb98fd66315a4aa477/diff",
"MergedDir": "/var/lib/docker/overlay2/2c86674adc5a83b6e3cfddf128be6ade85738a8de22f8037581b6c4488dc1d62/merged",
"UpperDir": "/var/lib/docker/overlay2/2c86674adc5a83b6e3cfddf128be6ade85738a8de22f8037581b6c4488dc1d62/diff",
"WorkDir": "/var/lib/docker/overlay2/2c86674adc5a83b6e3cfddf128be6ade85738a8de22f8037581b6c4488dc1d62/work"
},
"Name": "overlay2"
},
"Mounts": [
{
"Type": "volume",
"Name": "4e210407ea0e1cbaf8cbfa6aa398c545fdfe445788f2122ac4833e630183ff2d",
"Source": "/var/lib/docker/volumes/4e210407ea0e1cbaf8cbfa6aa398c545fdfe445788f2122ac4833e630183ff2d/_data",
"Destination": "/var/lib/mysql",
"Driver": "local",
"Mode": "",
"RW": true,
"Propagation": ""
}
],
"Config": {
"Hostname": "db",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"3306/tcp": {},
"33060/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"MYSQL_ROOT_PASSWORD=root",
"MYSQL_DATABASE=db",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"GOSU_VERSION=1.7",
"MYSQL_MAJOR=5.7",
"MYSQL_VERSION=5.7.29-1debian10"
],
"Cmd": [
"mysqld"
],
"Image": "mysql:5.7",
"Volumes": {
"/var/lib/mysql": {}
},
"WorkingDir": "",
"Entrypoint": [
"docker-entrypoint.sh"
],
"OnBuild": null,
"Labels": {}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "d4239e222f6d598c215560429a954f01403c53c9febf7f38fda47e50a9a349fc",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"3306/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "3307"
}
],
"33060/tcp": null
},
"SandboxKey": "/var/run/docker/netns/d4239e222f6d",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"services_backend": {
"IPAMConfig": null,
"Links": null,
"Aliases": [
"ea4e60e6f4ff"
],
"NetworkID": "1b77717f107f91593ee2859414077cf40275d616365b5065b5e5a10efdedc526",
"EndpointID": "d93bb6335c93955e45539e699623151a6f94c1115987cf9c2af46d030f48fa80",
"Gateway": "172.24.0.1",
"IPAddress": "172.24.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:18:00:02",
"DriverOpts": null
}
}
}
}
]

Fehlerfrei
[
{
"Id": "cd907d16156f151506ecf54eaba7a644196ee2af01b8da12d76c596fd23fc568",
"Created": "2020-04-06T09:55:42.725256041Z",
"Path": "docker-entrypoint.sh",
"Args": [
"mysqld"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 30473,
"ExitCode": 0,
"Error": "",
"StartedAt": "2020-04-06T21:31:41.004963783Z",
"FinishedAt": "2020-04-06T21:10:01.56721466Z"
},
"Image": "sha256:413be204e9c34f31476a0680b6521873fb519c749693b181228ff47492a7fe3b",
"ResolvConfPath": "/var/lib/docker/containers/cd907d16156f151506ecf54eaba7a644196ee2af01b8da12d76c596fd23fc568/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/cd907d16156f151506ecf54eaba7a644196ee2af01b8da12d76c596fd23fc568/hostname",
"HostsPath": "/var/lib/docker/containers/cd907d16156f151506ecf54eaba7a644196ee2af01b8da12d76c596fd23fc568/hosts",
"LogPath": "/var/lib/docker/containers/cd907d16156f151506ecf54eaba7a644196ee2af01b8da12d76c596fd23fc568/cd907d16156f151506ecf54eaba7a644196ee2af01b8da12d76c596fd23fc568-json.log",
"Name": "/services_db_1",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": [
"ed9d12ed3affb23294a92353ea065cba82050defb1eb9ec36f08cd68ee492dd5"
],
"HostConfig": {
"Binds": [
"services_db-data:/var/lib/mysql:rw"

],
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "services_backend",
"PortBindings": {
"3306/tcp": [
{
"HostIp": "",
"HostPort": "3307"
}
]
},
"RestartPolicy": {
"Name": "always",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": [],
"CapAdd": null,
"CapDrop": null,
"Capabilities": null,
"Dns": null,
"DnsOptions": null,
"DnsSearch": null,
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "shareable",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": null,
"DeviceCgroupRules": null,
"DeviceRequests": null,
"KernelMemory": 0,
"KernelMemoryTCP": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": null,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": [
"/proc/asound",
"/proc/acpi",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware"
],
"ReadonlyPaths": [
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
]
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/38ca2717ff80de7c40e5b502fb45eb76584eac5aa43afd59f817172528702189-init/diff:/var/lib/docker/overlay2/77c7305c881cda49167258e446a4df085e067527bb55e1efdae1639a2329be3b/diff:/var/lib/docker/overlay2/ecb016976ce3bc3cbbd42ae0b74fa53b33a8bcb6a1fa5b4741b8ecd4744e3b75/diff:/var/lib/docker/overlay2/f278fac24e82264109668d5e4c4bff0d2278f7efb45957f775d255ec4424626b/diff:/var/lib/docker/overlay2/561f5c0dfec783f088ad8cc6b5045bd12bda04724a0c39d95fa92b5b5756a96b/diff:/var/lib/docker/overlay2/151ef8f7769fbe5658b5abaa4a518286e4fd59bab49a80e69ea553d45fa0cc0e/diff:/var/lib/docker/overlay2/9f6f0800ba1a74a15f4a45e606998d9dbaaa608771c2b2a49c4097eca194d544/diff:/var/lib/docker/overlay2/e45692697084e45633a3f3d4300d2773a4c79fd7d62720d340fdf2466335129d/diff:/var/lib/docker/overlay2/f2f42ec1d44be2bd8565bed1ac26e307699f1e73b216a33725a137c9e08b7a0c/diff:/var/lib/docker/overlay2/a6a5efd0088263338b9aff398e6174dbdb89133b02fe16478a398d8926214b15/diff:/var/lib/docker/overlay2/75a186835637d294e7409a958754f58d39efa9acf49e416d24d8fbc7ca4b4af2/diff:/var/lib/docker/overlay2/7ed146c4897b4e5b9b4edff2f5220f3839ca13fd5d9e62eb98fd66315a4aa477/diff",
"MergedDir": "/var/lib/docker/overlay2/38ca2717ff80de7c40e5b502fb45eb76584eac5aa43afd59f817172528702189/merged",
"UpperDir": "/var/lib/docker/overlay2/38ca2717ff80de7c40e5b502fb45eb76584eac5aa43afd59f817172528702189/diff",
"WorkDir": "/var/lib/docker/overlay2/38ca2717ff80de7c40e5b502fb45eb76584eac5aa43afd59f817172528702189/work"
},
"Name": "overlay2"
},
"Mounts": [
{
"Type": "volume",
"Name": "services_db-data",
"Source": "/var/lib/docker/volumes/services_db-data/_data",
"Destination": "/var/lib/mysql",
"Driver": "local",
"Mode": "rw",
"RW": true,
"Propagation": ""
}
],
"Config": {
"Hostname": "cd907d16156f",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"3306/tcp": {},
"33060/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"MYSQL_DATABASE=db",
"MYSQL_USER=root",
"MYSQL_PASSWORD=root",
"MYSQL_ROOT_PASSWORD=root",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"GOSU_VERSION=1.7",
"MYSQL_MAJOR=5.7",
"MYSQL_VERSION=5.7.29-1debian10"
],
"Cmd": [
"mysqld"
],
"Image": "mysql:5.7",
"Volumes": {
"/var/lib/mysql": {}
},
"WorkingDir": "",
"Entrypoint": [
"docker-entrypoint.sh"
],
"OnBuild": null,
"Labels": {
"com.docker.compose.config-hash": "71a58fdf9eeee31e4e463d9b488214a9bf3669f7bdf7921c421fa383ae29d877",
"com.docker.compose.container-number": "1",
"com.docker.compose.oneoff": "False",
"com.docker.compose.project": "services",
"com.docker.compose.project.config_files": "docker-compose.yml",
"com.docker.compose.project.working_dir": "C:\\Users\\Meier\\Desktop\\services",
"com.docker.compose.service": "db",
"com.docker.compose.version": "1.25.4"
}

},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "358e9d6755bfc9a3ef4590cd11add73596f3d0a08f455d34c1883532a9094922",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"3306/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "3307"
}
],
"33060/tcp": null
},
"SandboxKey": "/var/run/docker/netns/358e9d6755bf",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"services_backend": {
"IPAMConfig": null,
"Links": null,
"Aliases": [
"db",
"cd907d16156f"
],
"NetworkID": "1b77717f107f91593ee2859414077cf40275d616365b5065b5e5a10efdedc526",
"EndpointID": "c33230c3cc4bf5eb7967e11365cd58eb231b0c55a3e4d4ce255115f20caf1209",
"Gateway": "172.24.0.1",
"IPAddress": "172.24.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:18:00:02",
"DriverOpts": null
}
}
}
}
]
 
mihe7

mihe7

Bei mir hatte dies leider keine spürbare Auswirkung.
Nein, bei Dir findet er den Host nicht...

Hab das grad mal getestet... hostname interessiert den DNS-Server nicht. Wenn Du aber den Container erst startest und dann per network connect --alias db services_backend <container-name> den Container <container-name> mit dem Netzwerk services_backend unter dem Alias db verbindest, dann ist der Container unter "db" von den anderen Containern im Netzwerk aus erreichbar.
 
J

JUUNND

Oh ja, es funktioniert! Vielen Dank! :) Dann kann ich das morgen ja mit dem push/pull auf dem anderen Host versuchen, aber sollte ja hoffentlich nicht mehr die Schwierigkeit sein!

Mal aus Interesse: Hast du das mit der nachträglichen Verbindung in das Netzwerk "einfach nur mal so" probiert ob das daran liegt, oder konntest du das aus den Logs herauslesen ? :D
 
mihe7

mihe7

Hast du das mit der nachträglichen Verbindung in das Netzwerk "einfach nur mal so" probiert ob das daran liegt, oder konntest du das aus den Logs herauslesen ? :D
Nein, aus den Logs war nur zu entnehmen, dass der Container im Netz nicht unter dem angegebenen Hostnamen zu finden ist. Naja, und dann gibt es etwas wie Dokumentation -> Test -> für gut befunden :)
 
Thema: 

Docker verstehen

Passende Stellenanzeigen aus deiner Region:
Anzeige

Neue Themen

Anzeige

Anzeige
Oben