Can't remote access on docker mariadb - docker
i'm facing a huge problem after updating my docker version from 17.10.0-ee-preview-3 to 20.10.20.
After putting back my mariadb docker, i cannot access it from outside anymore, even with the maridb conf file to accept remote connection and the docker run with publish attribute.
I used docker network create -d nat network to attach my container network but nat is not available anymore on that version, which can be the issue, i hope.
First, i used this docker run to create it : docker run --name GreenDB --env MARIADB_ROOT_PASSWORD=password --publish 3306:3306 mariadb
Even with the mariadb conf file updated to accept remote, i still can't access it, here's the file.
The MariaDB configuration file :
# #
The MariaDB/MySQL tools read configuration files in the following order:
0. "/etc/mysql/my.cnf" symlinks to this file, reason why all the rest is read.
1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
2. "/etc/mysql/conf.d/*.cnf" to set global options.
3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
4. "~/.my.cnf" to set user-specific options.
# #
If the same option is defined multiple times, the last one will apply.
# #
One can use all long options that the program supports.
Run program with --help to get a list of available options and with
# # --print-defaults to see which it would actually understand and use.
# #
If you are new to MariaDB, check out https://mariadb.com/kb/en/basic-mariadb-articles/
# #
This group is read both by the client and the server
use it for options that affect everything
# #
[client-server]
Port or socket location where to connect
port = 3306
socket = /run/mysqld/mysqld.sock
Import all .cnf files from configuration directory
[mariadbd]
skip-host-cache
skip-name-resolve
max_connections=250
bind-address=0.0.0.0
!includedir /etc/mysql/mariadb.conf.d/
!includedir /etc/mysql/conf.d/
Did i forgot something ?
Here's the docker inspect just in case :
[
{
"Id": "3516b606eb5ccc87db03c877821409462d3444c204e94e305a859d3a887199a6",
"Created": "2022-10-25T13:01:18.815337Z",
"Path": "docker-entrypoint.sh",
"Args": [
"mariadbd"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 35535,
"ExitCode": 0,
"Error": "",
"StartedAt": "2022-10-26T09:19:23.2219827Z",
"FinishedAt": "2022-10-26T09:19:22.7991342Z"
},
"Image": "sha256:14f1097913ecb422c61f9b35604339c1ac74394e7df7f84f765917b018605b5f",
"ResolvConfPath": "/var/lib/docker/containers/3516b606eb5ccc87db03c877821409462d3444c204e94e305a859d3a887199a6/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/3516b606eb5ccc87db03c877821409462d3444c204e94e305a859d3a887199a6/hostname",
"HostsPath": "/var/lib/docker/containers/3516b606eb5ccc87db03c877821409462d3444c204e94e305a859d3a887199a6/hosts",
"LogPath": "/var/lib/docker/containers/3516b606eb5ccc87db03c877821409462d3444c204e94e305a859d3a887199a6/3516b606eb5ccc87db03c877821409462d3444c204e94e305a859d3a887199a6-json.log",
"Name": "/GreenDB",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "default",
"PortBindings": {
"3306/tcp": [
{
"HostIp": "",
"HostPort": "3306"
}
]
},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"CgroupnsMode": "private",
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"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": [
50,
120
],
"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": null,
"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/e13bc3176c62a8f3fd27986eba038d51fa40f6455748f8914c92fed0b5255f54-init/diff:/var/lib/docker/overlay2/d42e6f685222a9ccdb24758762fe863f9cd56faf67dedfa05b57a05222a1bc5c/diff:/var/lib/docker/overlay2/2e35877fcf192254d1dcfc28a26ed7135d486cf8ae1eb156da7e494047aff060/diff:/var/lib/docker/overlay2/0619e74b00d5de6ecc1a2317a3af6eb35328c86d1f8cf12af8a4cf49142eac1b/diff:/var/lib/docker/overlay2/39c485f1146b25739b2ba393918683752f5c91d6fcfc257d927c82ed9f0fb061/diff:/var/lib/docker/overlay2/fa35ceb2ecaca4f90301e72455bdaa6bdaec1446abb088529c772306f48d96d6/diff:/var/lib/docker/overlay2/c31a6859826ce1917105cb64649843ea57592b042db6355eb50fc40a6a158ccd/diff:/var/lib/docker/overlay2/b7eea3560be9644ac53182bf90c943690f1185c5c091ff0f518b051061c5c84d/diff:/var/lib/docker/overlay2/7aeddc2e48e28ce55188fd4f3fbf386b700556b8760c3d01d7aae08bfb48f2ac/diff:/var/lib/docker/overlay2/bce33e0ae06075f8034070144a9575c07f7c65ae08151811d5c37f19493d5ed4/diff:/var/lib/docker/overlay2/b25cfc2b4f08ebe012050a95b76df3e4841743c7090b46bfe6e53e2b04047543/diff:/var/lib/docker/overlay2/5763da58e94725b158adbd0f68159ebb882b05d3a605f10e7ce8a7d64f7c3548/diff",
"MergedDir": "/var/lib/docker/overlay2/e13bc3176c62a8f3fd27986eba038d51fa40f6455748f8914c92fed0b5255f54/merged",
"UpperDir": "/var/lib/docker/overlay2/e13bc3176c62a8f3fd27986eba038d51fa40f6455748f8914c92fed0b5255f54/diff",
"WorkDir": "/var/lib/docker/overlay2/e13bc3176c62a8f3fd27986eba038d51fa40f6455748f8914c92fed0b5255f54/work"
},
"Name": "overlay2"
},
"Mounts": [
{
"Type": "volume",
"Name": "ed58f390a1c3c98e522bdeb335aec420d0f37d2f1b606024ba9b43f63b49d846",
"Source": "/var/lib/docker/volumes/ed58f390a1c3c98e522bdeb335aec420d0f37d2f1b606024ba9b43f63b49d846/_data",
"Destination": "/var/lib/mysql",
"Driver": "local",
"Mode": "",
"RW": true,
"Propagation": ""
}
],
"Config": {
"Hostname": "3516b606eb5c",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": true,
"AttachStderr": true,
"ExposedPorts": {
"3306/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"MARIADB_PASSWORD=*",
"MARIADB_ROOT_PASSWORD=*",
"MARIADB_USER=*",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"GOSU_VERSION=1.14",
"MARIADB_VERSION=1:10.9.3+maria~ubu2204"
],
"Cmd": [
"mariadbd"
],
"Image": "mariadb",
"Volumes": {
"/var/lib/mysql": {}
},
"WorkingDir": "",
"Entrypoint": [
"docker-entrypoint.sh"
],
"OnBuild": null,
"Labels": {}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "11ace205ac5b407ba6da2496ae0d911edf1fbf70796d50764b5215002cb269bc",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"3306/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "3306"
}
]
},
"SandboxKey": "/var/run/docker/netns/11ace205ac5b",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"pepiniere": {
"IPAMConfig": {},
"Links": null,
"Aliases": [
"3516b606eb5c"
],
"NetworkID": "0f1522a4430c7ab37a28171177cd6eacc24b57d4641a1b27a4528ea10a7e1bf5",
"EndpointID": "a563790191df8896a55af6f394810f98898849da00cacaf42fff0d49a2082eb1",
"Gateway": "172.19.0.1",
"IPAddress": "172.19.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:13:00:02",
"DriverOpts": null
}
}
}
}
]
I can't figure out what has changed from the last container.
Do you have an idea ? I'm stuck and desperate.
I'm pretty that's not about my database users ?
MariaDB [Project_Green]> select host,User from mysql.user;
+-----------+-----------------+
| Host | User |
+-----------+-----------------+
| % | Intelligence |
| % | express |
| % | interpreteddata |
| % | rawdata |
| % | root |
| % | weatherservice |
| localhost | express |
| localhost | interpreteddata |
| localhost | mariadb.sys |
| localhost | rawdata |
| localhost | root |
| localhost | weatherservice |
+-----------+-----------------+
edit : Added the docker logs as #10195153 said
PS C:\Users\admin\Documents\e> docker logs GreenDB
2022-10-26 12:17:48+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.9.3+maria~ubu2204 started.
2022-10-26 12:17:48+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-10-26 12:17:48+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.9.3+maria~ubu2204 started.
2022-10-26 12:17:48+00:00 [Note] [Entrypoint]: Initializing database files
PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following command:
'/usr/bin/mysql_secure_installation'
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the MariaDB Knowledgebase at https://mariadb.com/kb
Please report any problems at https://mariadb.org/jira
The latest information about MariaDB is available at https://mariadb.org/.
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/
2022-10-26 12:17:50+00:00 [Note] [Entrypoint]: Database files initialized
2022-10-26 12:17:50+00:00 [Note] [Entrypoint]: Starting temporary server
2022-10-26 12:17:50+00:00 [Note] [Entrypoint]: Waiting for server startup
2022-10-26 12:17:50 0 [Note] mariadbd (server 10.9.3-MariaDB-1:10.9.3+maria~ubu2204) starting as process 101 ...
2022-10-26 12:17:50 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-10-26 12:17:50 0 [Note] InnoDB: Using transactional memory
2022-10-26 12:17:50 0 [Note] InnoDB: Number of transaction pools: 1
2022-10-26 12:17:50 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2022-10-26 12:17:50 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
2022-10-26 12:17:50 0 [Note] InnoDB: Using liburing
2022-10-26 12:17:50 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
2022-10-26 12:17:50 0 [Note] InnoDB: Completed initialization of buffer pool
2022-10-26 12:17:50 0 [Note] InnoDB: File system buffers for log disabled (block size=4096 bytes)
2022-10-26 12:17:50 0 [Note] InnoDB: 128 rollback segments are active.
2022-10-26 12:17:50 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
2022-10-26 12:17:50 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
2022-10-26 12:17:50 0 [Note] InnoDB: log sequence number 46590; transaction id 14
2022-10-26 12:17:50 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-10-26 12:17:50 0 [Warning] 'user' entry 'root#de84fbaa6ec2' ignored in --skip-name-resolve mode.
2022-10-26 12:17:50 0 [Warning] 'proxies_priv' entry '#% root#de84fbaa6ec2' ignored in --skip-name-resolve mode.
2022-10-26 12:17:50 0 [Note] mariadbd: ready for connections.
Version: '10.9.3-MariaDB-1:10.9.3+maria~ubu2204' socket: '/run/mysqld/mysqld.sock' port: 0 mariadb.org binary distribution
2022-10-26 12:17:51+00:00 [Note] [Entrypoint]: Temporary server started.
2022-10-26 12:17:52+00:00 [Note] [Entrypoint]: Securing system users (equivalent to running mysql_secure_installation)
2022-10-26 12:17:52+00:00 [Note] [Entrypoint]: Stopping temporary server
2022-10-26 12:17:52 0 [Note] mariadbd (initiated by: unknown): Normal shutdown
2022-10-26 12:17:52 0 [Note] InnoDB: FTS optimize thread exiting.
2022-10-26 12:17:52 0 [Note] InnoDB: Starting shutdown...
2022-10-26 12:17:52 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2022-10-26 12:17:52 0 [Note] InnoDB: Buffer pool(s) dump completed at 221026 12:17:52
2022-10-26 12:17:52 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
2022-10-26 12:17:52 0 [Note] InnoDB: Shutdown completed; log sequence number 46590; transaction id 15
2022-10-26 12:17:52 0 [Note] mariadbd: Shutdown complete
2022-10-26 12:17:52+00:00 [Note] [Entrypoint]: Temporary server stopped
2022-10-26 12:17:52+00:00 [Note] [Entrypoint]: MariaDB init process done. Ready for start up.
2022-10-26 12:17:52 0 [Note] mariadbd (server 10.9.3-MariaDB-1:10.9.3+maria~ubu2204) starting as process 1 ...
2022-10-26 12:17:52 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-10-26 12:17:52 0 [Note] InnoDB: Using transactional memory
2022-10-26 12:17:52 0 [Note] InnoDB: Number of transaction pools: 1
2022-10-26 12:17:52 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2022-10-26 12:17:52 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
2022-10-26 12:17:52 0 [Note] InnoDB: Using liburing
2022-10-26 12:17:52 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
2022-10-26 12:17:52 0 [Note] InnoDB: Completed initialization of buffer pool
2022-10-26 12:17:52 0 [Note] InnoDB: File system buffers for log disabled (block size=4096 bytes)
2022-10-26 12:17:52 0 [Note] InnoDB: 128 rollback segments are active.
2022-10-26 12:17:52 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
2022-10-26 12:17:52 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
2022-10-26 12:17:52 0 [Note] InnoDB: log sequence number 46590; transaction id 14
2022-10-26 12:17:52 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2022-10-26 12:17:52 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-10-26 12:17:52 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
2022-10-26 12:17:52 0 [Note] InnoDB: Buffer pool(s) load completed at 221026 12:17:52
2022-10-26 12:17:52 0 [Note] Server socket created on IP: '0.0.0.0'.
2022-10-26 12:17:52 0 [Note] Server socket created on IP: '::'.
2022-10-26 12:17:52 0 [Note] mariadbd: ready for connections.
Version: '10.9.3-MariaDB-1:10.9.3+maria~ubu2204' socket: '/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
Thank you in advance
Related
Read timeout connecting to server on Docker container
I'm trying to connect to a DB/2 container (image: ibmcom/db2) but it gives me a read timeout error. The host OS is Windows 10. I can see the port (50000) in the Windows PowerShell prompt, but it gives me a read timeout. I've added an inbound Windows Defender rule to allow all local ports and an output rule to allow all remote ports. I have this regardless of the program. I realize this is not a good practice, but I'm trying to rule out a firewall issue. Despite this, it still gives me a read timeout error. I added more specific rules earlier, but they naturally did not help. I also started an SSH server in that container and could log into it from within the container, but not outside of it. When connecting from outside, I got the same read timeout message. I do not feel this is a db2 issue. Having said that, I was able to get sickp/alpine-sshd:7.5-r2 and gists/lighttpd to come start and be accessible from the host. That is, I can see the web default web page for lighttpd and log into the SSHD server for alpine-sshd. Both of these work with no appreciable delay. This worked before making the above firewall adjustments. I'm convinced that somehow, this container is not working for me. Other people have tried the exact same docker run that I provide below, and it comes up for them. I'm using Win 10, WSL2. Docker version 20.10.7, build f0df350. I start the container by doing: docker run -itd --name mydb-db2 \ --privileged=true \ -p 50000:50000 \ -e LICENSE=accept \ -e B2INSTANCE=db2inst1 \ -e DB2INST1_PASSWORD=<mypassword> \ -e DBNAME=MYDB \ -e TO_CREATE_SAMPLEDB=false \ -v db2:/database \ ibmcom/db2 Netstat evidence: C:\Software>netstat /a /n |grep 50000 TCP 0.0.0.0:50000 0.0.0.0:0 LISTENING TCP [::]:50000 [::]:0 LISTENING Attempt to connect to jdbc:db2://localhost:50000/MYDB on host system results in "Read timed out. ERRORCODE=-4499, SQLSTATE=08001" Docker container status: ~/projects-new/db2$ docker container ls CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 110aa19976dd ibmcom/db2 "/var/db2_setup/lib/…" 2 days ago Up 28 minutes 22/tcp, 55000/tcp, 60006-60007/tcp, 0.0.0.0:50000->50000/tcp, :::50000->50000/tcp mydb-db2 Inspection of container: ~/projects-new/db2$ docker container inspect 110aa [ { "Id": "110aa19976ddb53d16eac9376476f974fee8e9c699da3f76c1e2e13c444655c2", "Created": "2021-07-16T04:10:51.1247765Z", "Path": "/var/db2_setup/lib/setup_db2_instance.sh", "Args": [], "State": { "Status": "running", "Running": true, "Paused": false, "Restarting": false, "OOMKilled": false, "Dead": false, "Pid": 5459, "ExitCode": 0, "Error": "", "StartedAt": "2021-07-18T03:56:45.0493495Z", "FinishedAt": "2021-07-18T03:54:18.4239523Z" }, "Image": "sha256:a6a5ee354fb1242a75d508982041cd48883f3fe7c9c9b485be0da6c0ebd44a39", "ResolvConfPath": "/var/lib/docker/containers/110aa19976ddb53d16eac9376476f974fee8e9c699da3f76c1e2e13c444655c2/resolv.conf", "HostnamePath": "/var/lib/docker/containers/110aa19976ddb53d16eac9376476f974fee8e9c699da3f76c1e2e13c444655c2/hostname", "HostsPath": "/var/lib/docker/containers/110aa19976ddb53d16eac9376476f974fee8e9c699da3f76c1e2e13c444655c2/hosts", "LogPath": "/var/lib/docker/containers/110aa19976ddb53d16eac9376476f974fee8e9c699da3f76c1e2e13c444655c2/110aa19976ddb53d16eac9376476f974fee8e9c699da3f76c1e2e13c444655c2-json.log", "Name": "/mydb-db2", "RestartCount": 0, "Driver": "overlay2", "Platform": "linux", "MountLabel": "", "ProcessLabel": "", "AppArmorProfile": "", "ExecIDs": null, "HostConfig": { "Binds": [ "db2:/database" ], "ContainerIDFile": "", "LogConfig": { "Type": "json-file", "Config": {} }, "NetworkMode": "default", "PortBindings": { "50000/tcp": [ { "HostIp": "", "HostPort": "50000" } ] }, "RestartPolicy": { "Name": "no", "MaximumRetryCount": 0 }, "AutoRemove": false, "VolumeDriver": "", "VolumesFrom": null, "CapAdd": null, "CapDrop": null, "CgroupnsMode": "host", "Dns": [], "DnsOptions": [], "DnsSearch": [], "ExtraHosts": null, "GroupAdd": null, "IpcMode": "private", "Cgroup": "", "Links": null, "OomScoreAdj": 0, "PidMode": "", "Privileged": true, "PublishAllPorts": false, "ReadonlyRootfs": false, "SecurityOpt": [ "label=disable" ], "UTSMode": "", "UsernsMode": "", "ShmSize": 67108864, "Runtime": "runc", "ConsoleSize": [ 0, 0 ], "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": null, "ReadonlyPaths": null }, "GraphDriver": { "Data": { "LowerDir": "/var/lib/docker/overlay2/b6ecb6d5e949ab8e58d9238e34878a563a45f5045d57c684e5a08b6ec833ebb4-init/diff:/var/lib/docker/overlay2/6cf25bf1ac29315c3832316ef32b1cae8cf1ed6e71e4ddd9d08ab5566f81da9e/diff:/var/lib/docker/overlay2/76ca13571a6d253356b48ac20b408d33f80c5e6b429c132533e60c7578e99fb3/diff:/var/lib/docker/overlay2/e1a78196ef6f70929701e708904cb2696189c37a40839a0f20407148d2d90f1d/diff:/var/lib/docker/overlay2/efa2b4a3bc7e7411a671f05ad9121a4bb609452560b5f73d4b765e8519bfa36d/diff:/var/lib/docker/overlay2/933425814e17216adcfcac390e789c6dfc8ada12ded902db2ca9a542a5ff555c/diff:/var/lib/docker/overlay2/2ec2f25d859b77fd93a16468e40de569c41b35055c58277ad97d839cb33a01ac/diff:/var/lib/docker/overlay2/62aeaecc9fea67541671d95f691a2d8ddc9076ee0ae3bc96cd3b030a3ecc663b/diff:/var/lib/docker/overlay2/f04ce4e91dedc0c14073e43734ca252a7c0bd6f6ed9ab89f77d6797f72312f2d/diff:/var/lib/docker/overlay2/21b929e594040a64ffb0cd2c8bd4d3d7f630a3ec3dd79e8157c41c0d9783faa6/diff:/var/lib/docker/overlay2/c5e235fc2e9dc254394bcae472264b133530f5dfbb285cfe5f0ba0dac26ce4c4/diff:/var/lib/docker/overlay2/8f68a8bb1e9ca565aa1d8debc221bb498512a6ed24cc07bcf3ef07c8c42e045f/diff:/var/lib/docker/overlay2/745a0aa01d1a904ce08c22d07be527cdb39da0c37b87a66a57062cc307ca4d4c/diff:/var/lib/docker/overlay2/f0a873fda45d17a036833dd0dc9362f02b0ab00c590f23bf38ba59d06c624272/diff", "MergedDir": "/var/lib/docker/overlay2/b6ecb6d5e949ab8e58d9238e34878a563a45f5045d57c684e5a08b6ec833ebb4/merged", "UpperDir": "/var/lib/docker/overlay2/b6ecb6d5e949ab8e58d9238e34878a563a45f5045d57c684e5a08b6ec833ebb4/diff", "WorkDir": "/var/lib/docker/overlay2/b6ecb6d5e949ab8e58d9238e34878a563a45f5045d57c684e5a08b6ec833ebb4/work" }, "Name": "overlay2" }, "Mounts": [ { "Type": "volume", "Name": "db2", "Source": "/var/lib/docker/volumes/db2/_data", "Destination": "/database", "Driver": "local", "Mode": "z", "RW": true, "Propagation": "" }, { "Type": "volume", "Name": "47c06e44c75f70947a907a0972924536761f70f15971459e8be6015b29e2e48c", "Source": "/var/lib/docker/volumes/47c06e44c75f70947a907a0972924536761f70f15971459e8be6015b29e2e48c/_data", "Destination": "/hadr", "Driver": "local", "Mode": "", "RW": true, "Propagation": "" } ], "Config": { "Hostname": "110aa19976dd", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "ExposedPorts": { "22/tcp": {}, "50000/tcp": {}, "55000/tcp": {}, "60006/tcp": {}, "60007/tcp": {} }, "Tty": true, "OpenStdin": true, "StdinOnce": false, "Env": [ "LICENSE=accept", "B2INSTANCE=db2inst1", "DB2INST1_PASSWORD=<mypassword>", "DBNAME=BLUECOST", "TO_CREATE_SAMPLEDB=false", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "container=oci", "STORAGE_DIR=/database", "HADR_SHARED_DIR=/hadr", "DBPORT=50000", "TSPORT=55000", "SETUPDIR=/var/db2_setup", "SETUPAREA=/tmp/setup", "NOTVISIBLE=in users profile", "LICENSE_NAME=db2dec.lic" ], "Cmd": null, "Image": "ibmcom/db2", "Volumes": { "/database": {}, "/hadr": {} }, "WorkingDir": "", "Entrypoint": [ "/var/db2_setup/lib/setup_db2_instance.sh" ], "OnBuild": null, "Labels": { "architecture": "x86_64", "build-date": "2021-06-01T05:31:45.840349", "com.redhat.build-host": "cpt-1007.osbs.prod.upshift.rdu2.redhat.com", "com.redhat.component": "ubi7-container", "com.redhat.license_terms": "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI", "description": "The Universal Base Image is designed and engineered to be the base layer for all of your containerized applications, middleware and utilities. This base image is freely redistributable, but Red Hat only supports Red Hat technologies through subscriptions for Red Hat products. This image is maintained by Red Hat and updated regularly.", "desktop.docker.io/wsl-distro": "Ubuntu-20.04", "distribution-scope": "public", "io.k8s.description": "The Universal Base Image is designed and engineered to be the base layer for all of your containerized applications, middleware and utilities. This base image is freely redistributable, but Red Hat only supports Red Hat technologies through subscriptions for Red Hat products. This image is maintained by Red Hat and updated regularly.", "io.k8s.display-name": "Red Hat Universal Base Image 7", "io.openshift.tags": "base rhel7", "name": "ubi7", "release": "405", "summary": "Provides the latest release of the Red Hat Universal Base Image 7.", "url": "https://access.redhat.com/containers/#/registry.access.redhat.com/ubi7/images/7.9-405", "vcs-ref": "a4e710a688a6374670ecdd56637c3f683d11cbe3", "vcs-type": "git", "vendor": "Red Hat, Inc.", "version": "7.9" } }, "NetworkSettings": { "Bridge": "", "SandboxID": "570856178f99951c7cdfccc638a3404f906a7a89905ba9d39181cd9310f4380b", "HairpinMode": false, "LinkLocalIPv6Address": "", "LinkLocalIPv6PrefixLen": 0, "Ports": { "22/tcp": null, "50000/tcp": [ { "HostIp": "0.0.0.0", "HostPort": "50000" }, { "HostIp": "::", "HostPort": "50000" } ], "55000/tcp": null, "60006/tcp": null, "60007/tcp": null }, "SandboxKey": "/var/run/docker/netns/570856178f99", "SecondaryIPAddresses": null, "SecondaryIPv6Addresses": null, "EndpointID": "a50d8643af88c0d677a9dc2d889f20ab909f46707bb7bd0f8168666b18d1b414", "Gateway": "172.17.0.1", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "IPAddress": "172.17.0.2", "IPPrefixLen": 16, "IPv6Gateway": "", "MacAddress": "02:42:ac:11:00:02", "Networks": { "bridge": { "IPAMConfig": null, "Links": null, "Aliases": null, "NetworkID": "408fe3a7130f9791810b8668b60b7f90478f4673f79270539044362e8c12d88f", "EndpointID": "a50d8643af88c0d677a9dc2d889f20ab909f46707bb7bd0f8168666b18d1b414", "Gateway": "172.17.0.1", "IPAddress": "172.17.0.2", "IPPrefixLen": 16, "IPv6Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "MacAddress": "02:42:ac:11:00:02", "DriverOpts": null } } } } ] I didn't see the db2 container listed. These are my networks: C:\Software>docker network ls NETWORK ID NAME DRIVER SCOPE 408fe3a7130f bridge bridge local 38fc17e8e6f1 cirrus-ssc-file-sender_default bridge local 1668ab71959f host host local 4bf4f6b3a57e minikube bridge local e07fc0032414 none null local Instead, I found it on the bridge network. I'm not trying to do anything fancy. I'd really rather it run on the same network host. If the host system can "see" the exposed port of 50000 via Netstat, wouldn't that mean it's not a firewall issue? Update: I turned off Windows Defender and it still does not work. Update 2: I hosted the same container on a different machine but on my home network. When I try to connect to it from the problem machine, it gives me the same read timeout error. However, it works from the hosting machine. Somehow there seems to be a problem between this particular Windows machine and this particular container. Update 3: SVCENAME info: I ran the following inside the db2 container: $su db2inst1 (when I log in it goes to root) $cd ~ $. ./.bashrc $db2 get dbm cfg |grep SVCENAME TCP/IP Service name (SVCENAME) = db2c_db2inst1 SSL service name (SSL_SVCENAME) = $grep dbc2_db2inst1 /etc/services db2c_db2inst1 50000/tcp db2c_db2inst1_ssl 50001/tcp DB2 Container OS Version info: $ cat /etc/*release NAME="Red Hat Enterprise Linux Server" VERSION="7.9 (Maipo)" ID="rhel" ID_LIKE="fedora" VARIANT="Server" VARIANT_ID="server" VERSION_ID="7.9" PRETTY_NAME="Red Hat Enterprise Linux Server 7.9 (Maipo)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:redhat:enterprise_linux:7.9:GA:server" HOME_URL="https://www.redhat.com/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7" REDHAT_BUGZILLA_PRODUCT_VERSION=7.9 REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" REDHAT_SUPPORT_PRODUCT_VERSION="7.9" Red Hat Enterprise Linux Server release 7.9 (Maipo) Red Hat Enterprise Linux Server release 7.9 (Maipo) WSL Linux version used: $ cat /etc/*release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=20.04 DISTRIB_CODENAME=focal DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS" NAME="Ubuntu" VERSION="20.04.1 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.1 LTS" VERSION_ID="20.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal UBUNTU_CODENAME=focal Windows version info of the host system (from winver): Windows 10 Version 21H1 (OS Build 19043.1110) Computer successfully connecting to DB/2 container: $ cat /etc/*release Fedora release 30 (Thirty) NAME=Fedora VERSION="30 (Workstation Edition)" ID=fedora VERSION_ID=30 VERSION_CODENAME="" PLATFORM_ID="platform:f30" PRETTY_NAME="Fedora 30 (Workstation Edition)" ANSI_COLOR="0;34" LOGO=fedora-logo-icon CPE_NAME="cpe:/o:fedoraproject:fedora:30" HOME_URL="https://fedoraproject.org/" DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f30/system-administrators-guide/" SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Fedora" REDHAT_BUGZILLA_PRODUCT_VERSION=30 REDHAT_SUPPORT_PRODUCT="Fedora" REDHAT_SUPPORT_PRODUCT_VERSION=30 PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy" VARIANT="Workstation Edition" VARIANT_ID=workstation Fedora release 30 (Thirty) Fedora release 30 (Thirty)
Your symptom might be caused by some machine specific configuration, or some downlevel component (in particular WSL2). On my hardware, at the current date, with current version of WSL2, ibmcom/db2 accepts connections from the local MS-Windows host (via jdbc ) with the following mix of components: MS-Windows 10 Pro build 19043 (21H1) x64 the latest build of the "Linux WSL2 kernel package for x64 machines" Docker Desktop 3.5.2 configured to use WSL2 However, with a previous mix of configurations , I recreated your failure symptom with WSL2, i.e. jdbc connection attempt from local MSWindows host into the linux container gave sqlcode -4499 (in my case reply.fill() insufficient data). The failing combination was: MS-Windows 10 Pro build 19041 x64. older build of "Linux WSL2 kernel package for x64 machines" (downloaded before 22/July/2021) Docker Desktop 3.5.2 configured for WSL2 With the previous failing combination, only WSL2 back end recreated your symptom, but the Hyper-V back end worked correctly. With Docker-Desktop on a Win10PRO environment, right click on its icon, choose Settings, and it lets you tick (or untick) "Use WSL2 based engine", click Apply and Restart. You may get other notifications. You may lose your containers and images and need to download them again so if you need to preserve any data then arrange that separately before changing the back end. If you cannot make progress via upgrading components, then a re-install or image may be an option.
docker-compose with adminer & mariadb shows 403 on attempted database connection
I have spent the last few hours debugging my system and I am at a loss as to what is going on here. I am using a simple docker-compose.yml file to start a mariadb and an adminer instance on my Ubuntu 20.04 LTS system. docker-compose.yml: version: '3' services: database: image: mariadb restart: always environment: MYSQL_DATABASE: feedback MYSQL_USER: db_user MYSQL_PASSWORD: password MYSQL_ROOT_PASSWORD: root adminer: image: adminer restart: always environment: ADMINER_DEFAULT_SERVER: database ports: - "127.0.0.1:8080:8080" A coworker tested this and it works 100% of the time on their system. However, it only worked twice out of many, many tries in the last few hours one my system. This is the docker-compose output: Creating knowledge-base_database_1 ... done Creating knowledge-base_adminer_1 ... done Attaching to knowledge-base_adminer_1, knowledge-base_database_1 database_1 | 2021-05-31 12:17:04+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.5.10+maria~focal started. adminer_1 | [Mon May 31 12:17:04 2021] PHP 7.4.19 Development Server (http://[::]:8080) started database_1 | 2021-05-31 12:17:04+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql' database_1 | 2021-05-31 12:17:04+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.5.10+maria~focal started. database_1 | 2021-05-31 12:17:05+00:00 [Note] [Entrypoint]: Initializing database files database_1 | database_1 | database_1 | PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER ! database_1 | To do so, start the server, then issue the following command: database_1 | database_1 | '/usr/bin/mysql_secure_installation' database_1 | database_1 | which will also give you the option of removing the test database_1 | databases and anonymous user created by default. This is database_1 | strongly recommended for production servers. database_1 | database_1 | See the MariaDB Knowledgebase at https://mariadb.com/kb or the database_1 | MySQL manual for more instructions. database_1 | database_1 | Please report any problems at https://mariadb.org/jira database_1 | database_1 | The latest information about MariaDB is available at https://mariadb.org/. database_1 | You can find additional information about the MySQL part at: database_1 | https://dev.mysql.com database_1 | Consider joining MariaDB's strong and vibrant community: database_1 | https://mariadb.org/get-involved/ database_1 | database_1 | 2021-05-31 12:17:06+00:00 [Note] [Entrypoint]: Database files initialized database_1 | 2021-05-31 12:17:06+00:00 [Note] [Entrypoint]: Starting temporary server database_1 | 2021-05-31 12:17:06+00:00 [Note] [Entrypoint]: Waiting for server startup database_1 | 2021-05-31 12:17:06 0 [Note] mysqld (mysqld 10.5.10-MariaDB-1:10.5.10+maria~focal) starting as process 99 ... database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: Uses event mutexes database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: Number of pools: 1 database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions database_1 | 2021-05-31 12:17:06 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts) database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: Using Linux native AIO database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728 database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: Completed initialization of buffer pool database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: 128 rollback segments are active. database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: Creating shared tablespace for temporary tables database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB. database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: 10.5.10 started; log sequence number 45118; transaction id 20 database_1 | 2021-05-31 12:17:06 0 [Note] Plugin 'FEEDBACK' is disabled. database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool database_1 | 2021-05-31 12:17:06 0 [Note] InnoDB: Buffer pool(s) load completed at 210531 12:17:06 database_1 | 2021-05-31 12:17:06 0 [Warning] 'user' entry 'root#5315aa145a33' ignored in --skip-name-resolve mode. database_1 | 2021-05-31 12:17:06 0 [Warning] 'proxies_priv' entry '#% root#5315aa145a33' ignored in --skip-name-resolve mode. database_1 | 2021-05-31 12:17:06 0 [Note] Reading of all Master_info entries succeeded database_1 | 2021-05-31 12:17:06 0 [Note] Added new Master_info '' to hash table database_1 | 2021-05-31 12:17:06 0 [Note] mysqld: ready for connections. database_1 | Version: '10.5.10-MariaDB-1:10.5.10+maria~focal' socket: '/run/mysqld/mysqld.sock' port: 0 mariadb.org binary distribution database_1 | 2021-05-31 12:17:07+00:00 [Note] [Entrypoint]: Temporary server started. database_1 | Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it. database_1 | Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it. database_1 | Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it. database_1 | 2021-05-31 12:17:09 5 [Warning] 'proxies_priv' entry '#% root#5315aa145a33' ignored in --skip-name-resolve mode. database_1 | 2021-05-31 12:17:09+00:00 [Note] [Entrypoint]: Creating database feedback database_1 | 2021-05-31 12:17:09+00:00 [Note] [Entrypoint]: Creating user db_user database_1 | 2021-05-31 12:17:09+00:00 [Note] [Entrypoint]: Giving user db_user access to schema feedback database_1 | database_1 | 2021-05-31 12:17:09+00:00 [Note] [Entrypoint]: Stopping temporary server database_1 | 2021-05-31 12:17:09 0 [Note] mysqld (initiated by: root[root] # localhost []): Normal shutdown database_1 | 2021-05-31 12:17:09 0 [Note] Event Scheduler: Purging the queue. 0 events database_1 | 2021-05-31 12:17:09 0 [Note] InnoDB: FTS optimize thread exiting. database_1 | 2021-05-31 12:17:09 0 [Note] InnoDB: Starting shutdown... database_1 | 2021-05-31 12:17:09 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool database_1 | 2021-05-31 12:17:09 0 [Note] InnoDB: Buffer pool(s) dump completed at 210531 12:17:09 database_1 | 2021-05-31 12:17:09 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1" database_1 | 2021-05-31 12:17:09 0 [Note] InnoDB: Shutdown completed; log sequence number 45130; transaction id 21 database_1 | 2021-05-31 12:17:09 0 [Note] mysqld: Shutdown complete database_1 | database_1 | 2021-05-31 12:17:10+00:00 [Note] [Entrypoint]: Temporary server stopped database_1 | database_1 | 2021-05-31 12:17:10+00:00 [Note] [Entrypoint]: MariaDB init process done. Ready for start up. database_1 | database_1 | 2021-05-31 12:17:10 0 [Note] mysqld (mysqld 10.5.10-MariaDB-1:10.5.10+maria~focal) starting as process 1 ... database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: Uses event mutexes database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: Number of pools: 1 database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions database_1 | 2021-05-31 12:17:10 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts) database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: Using Linux native AIO database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728 database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: Completed initialization of buffer pool database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: 128 rollback segments are active. database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: Creating shared tablespace for temporary tables database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB. database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: 10.5.10 started; log sequence number 45130; transaction id 20 database_1 | 2021-05-31 12:17:10 0 [Note] Plugin 'FEEDBACK' is disabled. database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool database_1 | 2021-05-31 12:17:10 0 [Note] InnoDB: Buffer pool(s) load completed at 210531 12:17:10 database_1 | 2021-05-31 12:17:10 0 [Note] Server socket created on IP: '::'. database_1 | 2021-05-31 12:17:10 0 [Warning] 'proxies_priv' entry '#% root#5315aa145a33' ignored in --skip-name-resolve mode. database_1 | 2021-05-31 12:17:10 0 [Note] Reading of all Master_info entries succeeded database_1 | 2021-05-31 12:17:10 0 [Note] Added new Master_info '' to hash table database_1 | 2021-05-31 12:17:10 0 [Note] mysqld: ready for connections. database_1 | Version: '10.5.10-MariaDB-1:10.5.10+maria~focal' socket: '/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution Trying to log into the database with adminer using root:root produces the following output: adminer_1 | [Mon May 31 12:17:54 2021] [::ffff:172.25.0.1]:38170 Accepted adminer_1 | [Mon May 31 12:17:54 2021] [::ffff:172.25.0.1]:38170 [302]: POST /?server=database&username=root adminer_1 | [Mon May 31 12:17:54 2021] [::ffff:172.25.0.1]:38170 Closing adminer_1 | [Mon May 31 12:17:54 2021] [::ffff:172.25.0.1]:38174 Accepted adminer_1 | [Mon May 31 12:18:24 2021] [::ffff:172.25.0.1]:38174 [403]: GET /?server=database&username=root adminer_1 | [Mon May 31 12:18:24 2021] [::ffff:172.25.0.1]:38174 Closing adminer_1 | [Mon May 31 12:18:24 2021] [::ffff:172.25.0.1]:38208 Accepted adminer_1 | [Mon May 31 12:18:24 2021] [::ffff:172.25.0.1]:38208 [200]: GET /?file=favicon.ico&version=4.8.0 adminer_1 | [Mon May 31 12:18:24 2021] [::ffff:172.25.0.1]:38208 Closing I have tried disabling my firewall, reinstalling docker and docker-compose, creating a custom network with docker instead of using docker-compose's default network, etc. I also started a known-working project on my system, which yielded the same results. Something on my system seems to be broken, but I don't know where to look anymore. Does anyone have any ideas what I can try to get this working?
Try appending /index.php so instead of http://localhost go to http://localhost/index.php
Docker - mysql db getting installed but user not getting created
I am trying to create a hybrid container. Following is my docker-compose file. version: "2" services: database: build: context: ./registration-database image: registration-database # set default mysql root password, change as needed environment: MYSQL_ROOT_PASSWORD: password # Expose port 3306 to host. ports: - "3306:3306" restart: always webserver: build: context: ./registration-webserver image: registration-webserver # mount point for application in tomcat volumes: - ./app/target/UserSignup:/usr/local/tomcat/webapps/UserSignup links: - database:registration-database # open ports for tomcat and remote debugging ports: - "8080:8080" - "8000:8000" restart: always Following is the dockerFile for mysql: FROM mysql:5.7 # Copy the database initialize script: # Contents of /docker-entrypoint-initdb.d are run on mysqld startup ADD docker-entrypoint-initdb.d/ /docker-entrypoint-initdb.d/ ENV MYSQL_DATABASE=ishan ENV MYSQL_USER=ishan ENV MYSQL_PASSWORD=password Following is the initialize_db.sql file USE `ishan`; CREATE TABLE `user` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `dateOfBirth` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP , `emailAddress` varchar(255) NOT NULL, `firstName` varchar(255) NOT NULL, `lastName` varchar(255) NOT NULL, `password` varchar(8) NOT NULL, `userName` varchar(20) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=latin1; Earlier when I was running the command docker-compose up it was creating the user ishan and it was creating the user table also. But now, suddenly something happened although the mysql is getting installed with the root user but the new user (ishan) and the table is not getting created. Any help is appreciated. Following is the log which is getting printed on startup: Starting app_database_1 ... done Starting app_webserver_1 ... done Attaching to app_database_1, app_webserver_1 database_1 | 2019-04-09T08:30:51.326732Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). database_1 | 2019-04-09T08:30:51.327850Z 0 [Note] mysqld (mysqld 5.7.25) starting as process 1 ... database_1 | 2019-04-09T08:30:51.330081Z 0 [Note] InnoDB: PUNCH HOLE support available database_1 | 2019-04-09T08:30:51.330114Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins database_1 | 2019-04-09T08:30:51.330118Z 0 [Note] InnoDB: Uses event mutexes database_1 | 2019-04-09T08:30:51.330121Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier database_1 | 2019-04-09T08:30:51.330125Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 database_1 | 2019-04-09T08:30:51.330127Z 0 [Note] InnoDB: Using Linux native AIO database_1 | 2019-04-09T08:30:51.330295Z 0 [Note] InnoDB: Number of pools: 1 database_1 | 2019-04-09T08:30:51.330382Z 0 [Note] InnoDB: Using CPU crc32 instructions database_1 | 2019-04-09T08:30:51.331394Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M database_1 | 2019-04-09T08:30:51.336481Z 0 [Note] InnoDB: Completed initialization of buffer pool database_1 | 2019-04-09T08:30:51.338022Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). database_1 | 2019-04-09T08:30:51.356556Z 0 [Note] InnoDB: Highest supported file format is Barracuda. database_1 | 2019-04-09T08:30:51.372677Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables database_1 | 2019-04-09T08:30:51.372933Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... database_1 | 2019-04-09T08:30:51.398496Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB. database_1 | 2019-04-09T08:30:51.399884Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active. database_1 | 2019-04-09T08:30:51.399990Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active. database_1 | 2019-04-09T08:30:51.400792Z 0 [Note] InnoDB: 5.7.25 started; log sequence number 12359503 database_1 | 2019-04-09T08:30:51.401039Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool database_1 | 2019-04-09T08:30:51.401382Z 0 [Note] Plugin 'FEDERATED' is disabled. database_1 | 2019-04-09T08:30:51.419097Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them. database_1 | 2019-04-09T08:30:51.421195Z 0 [Warning] CA certificate ca.pem is self signed. database_1 | 2019-04-09T08:30:51.423199Z 0 [Note] Server hostname (bind-address): '*'; port: 3306 database_1 | 2019-04-09T08:30:51.423332Z 0 [Note] IPv6 is available. database_1 | 2019-04-09T08:30:51.423468Z 0 [Note] - '::' resolves to '::'; database_1 | 2019-04-09T08:30:51.423622Z 0 [Note] Server socket created on IP: '::'. database_1 | 2019-04-09T08:30:51.430839Z 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. database_1 | 2019-04-09T08:30:51.434012Z 0 [Note] InnoDB: Buffer pool(s) load completed at 190409 8:30:51 database_1 | 2019-04-09T08:30:51.437767Z 0 [Warning] 'user' entry 'root#localhost' ignored in --skip-name-resolve mode. database_1 | 2019-04-09T08:30:51.437887Z 0 [Warning] 'user' entry 'mysql.session#localhost' ignored in --skip-name-resolve mode. database_1 | 2019-04-09T08:30:51.438037Z 0 [Warning] 'user' entry 'mysql.sys#localhost' ignored in --skip-name-resolve mode. database_1 | 2019-04-09T08:30:51.438612Z 0 [Warning] 'db' entry 'performance_schema mysql.session#localhost' ignored in --skip-name-resolve mode. database_1 | 2019-04-09T08:30:51.438712Z 0 [Warning] 'db' entry 'sys mysql.sys#localhost' ignored in --skip-name-resolve mode. database_1 | 2019-04-09T08:30:51.439004Z 0 [Warning] 'proxies_priv' entry '# root#localhost' ignored in --skip-name-resolve mode. database_1 | 2019-04-09T08:30:51.451035Z 0 [Warning] 'tables_priv' entry 'user mysql.session#localhost' ignored in --skip-name-resolve mode. database_1 | 2019-04-09T08:30:51.451161Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys#localhost' ignored in --skip-name-resolve mode. database_1 | 2019-04-09T08:30:51.484566Z 0 [Note] Event Scheduler: Loaded 0 events database_1 | 2019-04-09T08:30:51.485090Z 0 [Note] mysqld: ready for connections. database_1 | Version: '5.7.25' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
Most probably your volume is still present and for that reason MySQL ignores the entrypoint folder. You need to delete the volume between runs to get a fresh start. Be aware that this means losing data saved in mysql in the meantime. docker-compose down # this will clean all volumes not in use by any containers docker volume prune Run docker volume ls to make sure your volume is gone and then run your docker-compose again.
Docker secret not working for MYSQL_ROOT_PASSWORD_FILE
I'm learning about docker secrets to be used to store the mysql password for my lamp container stack. I am running docker for Windows 17.06.0-ce-win18 (12627). I followed these steps: 1 - Created secret in docker as follows: echo password | docker secret create mysql_db_root - 2 - Created the compose file shown below: version: "3.1" services: apachephp: image: apachephp deploy: replicas: 1 # restart_policy: # condition: on-failure resources: limits: cpus: "0.1" memory: 50M ports: - "80:80" - "443:443" volumes: - C:\Users\Daniel\Desktop\Learning\DockerStuff\phpdev\www:/var/www/html networks: - webnet db: image: mysql:latest ports: - "3306:3306" volumes: - C:\Users\Daniel\Desktop\Learning\DockerStuff\phpdev\db:/var/lib/mysql secrets: - mysql_db_root environment: MYSQL_ROOT_PASSWORD_FILE: /run/secrets/mysql_db_root #MYSQL_ROOT_PASSWORD: "password" networks: - webnet adminer: image: adminer ports: - 8080:8080 networks: - webnet secrets: mysql_db_root: external: true networks: webnet: 3 - Checked to ensure secret is available inside mysql container C:\Learning\DockerStuff\phpdev>docker exec -it 452 bash root#45278a63bc6b:/# cat /run/secrets/mysql_db_root password 4 - So the password is available, now try to login to mysql: root#45278a63bc6b:/# mysql root#45278a63bc6b:/# mysql -u root -p -h localhost Enter password: ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES) And the password "password" does not work! Can anyonoe shed any light on this? Thanks in advance! The mysql container log is below: lampstack_db.1.wgofhqdl1v33#moby | Initializing database lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:16.743604Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:17.468430Z 0 [Warning] InnoDB: New log files created, LSN=45790 lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:17.563991Z 0 [Warning] InnoDB: Creating foreign key constraint system tables. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:17.574436Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 207c7b19-5cda-11e7-854a-02420aff0004. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:17.578567Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:17.584520Z 1 [Warning] root#localhost is created with an empty password ! Please consider switching off the --initialize-insecure option. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:20.354931Z 1 [Warning] 'user' entry 'root#localhost' ignored in --skip-name-resolve mode. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:20.354971Z 1 [Warning] 'user' entry 'mysql.sys#localhost' ignored in --skip-name-resolve mode. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:20.354980Z 1 [Warning] 'db' entry 'sys mysql.sys#localhost' ignored in --skip-name-resolve mode. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:20.354987Z 1 [Warning] 'proxies_priv' entry '# root#localhost' ignored in --skip-name-resolve mode. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:20.355007Z 1 [Warning] 'tables_priv' entry 'sys_config mysql.sys#localhost' ignored in --skip-name-resolve mode. lampstack_db.1.wgofhqdl1v33#moby | Database initialized lampstack_db.1.wgofhqdl1v33#moby | Initializing certificates lampstack_db.1.wgofhqdl1v33#moby | Generating a 2048 bit RSA private key lampstack_db.1.wgofhqdl1v33#moby | ..............................................................................................+++ lampstack_db.1.wgofhqdl1v33#moby | ...............+++ lampstack_db.1.wgofhqdl1v33#moby | unable to write 'random state' lampstack_db.1.wgofhqdl1v33#moby | writing new private key to 'ca-key.pem' lampstack_db.1.wgofhqdl1v33#moby | ----- lampstack_db.1.wgofhqdl1v33#moby | Generating a 2048 bit RSA private key lampstack_db.1.wgofhqdl1v33#moby | ..............................+++ lampstack_db.1.wgofhqdl1v33#moby | ..+++ lampstack_db.1.wgofhqdl1v33#moby | unable to write 'random state' lampstack_db.1.wgofhqdl1v33#moby | writing new private key to 'server-key.pem' lampstack_db.1.wgofhqdl1v33#moby | ----- lampstack_db.1.wgofhqdl1v33#moby | Generating a 2048 bit RSA private key lampstack_db.1.wgofhqdl1v33#moby | ............+++ lampstack_db.1.wgofhqdl1v33#moby | .............+++ lampstack_db.1.wgofhqdl1v33#moby | unable to write 'random state' lampstack_db.1.wgofhqdl1v33#moby | writing new private key to 'client-key.pem' lampstack_db.1.wgofhqdl1v33#moby | ----- lampstack_db.1.wgofhqdl1v33#moby | Certificates initialized lampstack_db.1.wgofhqdl1v33#moby | MySQL init process in progress... lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.668312Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.674228Z 0 [Note] mysqld (mysqld 5.7.18) starting as process 89 ... lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.681123Z 0 [Note] InnoDB: PUNCH HOLE support available lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.681142Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.681145Z 0 [Note] InnoDB: Uses event mutexes lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.681147Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.681149Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3 lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.681151Z 0 [Note] InnoDB: Using Linux native AIO lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.681304Z 0 [Note] InnoDB: Number of pools: 1 lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.681369Z 0 [Note] InnoDB: Using CPU crc32 instructions lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.682440Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.687878Z 0 [Note] InnoDB: Completed initialization of buffer pool lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.689386Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.721122Z 0 [Note] InnoDB: Highest supported file format is Barracuda. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.755720Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.756235Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.830478Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.840143Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.840161Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.840606Z 0 [Note] InnoDB: Waiting for purge to start lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.891432Z 0 [Note] InnoDB: 5.7.18 started; log sequence number 2535558 lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.891977Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.892056Z 0 [Note] Plugin 'FEDERATED' is disabled. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.931384Z 0 [Note] InnoDB: Buffer pool(s) load completed at 170629 14:49:23 lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.934426Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.936509Z 0 [Warning] CA certificate ca.pem is self signed. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.952553Z 0 [Warning] 'user' entry 'root#localhost' ignored in --skip-name-resolve mode. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.952645Z 0 [Warning] 'user' entry 'mysql.sys#localhost' ignored in --skip-name-resolve mode. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.952829Z 0 [Warning] 'db' entry 'sys mysql.sys#localhost' ignored in --skip-name-resolve mode. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.953123Z 0 [Warning] 'proxies_priv' entry '# root#localhost' ignored in --skip-name-resolve mode. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:23.976984Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys#localhost' ignored in --skip-name-resolve mode. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:24.115430Z 0 [Note] Event Scheduler: Loaded 0 events lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:24.115572Z 0 [Note] mysqld: ready for connections. lampstack_db.1.wgofhqdl1v33#moby | Version: '5.7.18' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server (GPL) lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:24.115578Z 0 [Note] Executing 'SELECT * FROM INFORMATION_SCHEMA.TABLES;' to get a list of tables using the deprecated partition engine. You may use the startup option '--disable-partition-engine-check' to skip this check. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:24.115580Z 0 [Note] Beginning of list of non-natively partitioned tables lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:24.235357Z 0 [Note] End of list of non-natively partitioned tables lampstack_db.1.wgofhqdl1v33#moby | Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it. lampstack_db.1.wgofhqdl1v33#moby | Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it. lampstack_db.1.wgofhqdl1v33#moby | Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.307433Z 5 [Warning] 'user' entry 'root#localhost' ignored in --skip-name-resolve mode. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.307454Z 5 [Warning] 'user' entry 'mysql.sys#localhost' ignored in --skip-name-resolve mode. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.307466Z 5 [Warning] 'db' entry 'sys mysql.sys#localhost' ignored in --skip-name-resolve mode. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.307476Z 5 [Warning] 'proxies_priv' entry '# root#localhost' ignored in --skip-name-resolve mode. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.307498Z 5 [Warning] 'tables_priv' entry 'sys_config mysql.sys#localhost' ignored in --skip-name-resolve mode. lampstack_db.1.wgofhqdl1v33#moby | lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.308688Z 0 [Note] Giving 0 client threads a chance to die gracefully lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.308701Z 0 [Note] Shutting down slave threads lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.308704Z 0 [Note] Forcefully disconnecting 0 remaining clients lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.308706Z 0 [Note] Event Scheduler: Purging the queue. 0 events lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.308730Z 0 [Note] Binlog end lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317357Z 0 [Note] Shutting down plugin 'ngram' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317377Z 0 [Note] Shutting down plugin 'BLACKHOLE' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317381Z 0 [Note] Shutting down plugin 'partition' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317383Z 0 [Note] Shutting down plugin 'ARCHIVE' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317385Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317387Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317388Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317389Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317391Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317392Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317393Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317394Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317395Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317397Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317398Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317399Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317400Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317401Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317403Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317404Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317405Z 0 [Note] Shutting down plugin 'INNODB_METRICS' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317406Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317408Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317409Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317410Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317411Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317412Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317414Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317415Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317417Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317419Z 0 [Note] Shutting down plugin 'INNODB_CMP' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317421Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317423Z 0 [Note] Shutting down plugin 'INNODB_LOCKS' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317425Z 0 [Note] Shutting down plugin 'INNODB_TRX' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317427Z 0 [Note] Shutting down plugin 'InnoDB' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317486Z 0 [Note] InnoDB: FTS optimize thread exiting. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.317588Z 0 [Note] InnoDB: Starting shutdown... lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.418806Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:26.428161Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 170629 14:49:26 lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:27.856347Z 0 [Note] InnoDB: Shutdown completed; log sequence number 12139694 lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:27.859197Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1" lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:27.859225Z 0 [Note] Shutting down plugin 'MRG_MYISAM' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:27.859229Z 0 [Note] Shutting down plugin 'MyISAM' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:27.859239Z 0 [Note] Shutting down plugin 'CSV' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:27.859280Z 0 [Note] Shutting down plugin 'MEMORY' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:27.859282Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:27.859306Z 0 [Note] Shutting down plugin 'sha256_password' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:27.859312Z 0 [Note] Shutting down plugin 'mysql_native_password' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:27.859446Z 0 [Note] Shutting down plugin 'binlog' lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:27.860931Z 0 [Note] mysqld: Shutdown complete lampstack_db.1.wgofhqdl1v33#moby | lampstack_db.1.wgofhqdl1v33#moby | lampstack_db.1.wgofhqdl1v33#moby | MySQL init process done. Ready for start up. lampstack_db.1.wgofhqdl1v33#moby | lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.121719Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.126586Z 0 [Note] mysqld (mysqld 5.7.18) starting as process 1 ... lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.134269Z 0 [Note] InnoDB: PUNCH HOLE support available lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.134297Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.134301Z 0 [Note] InnoDB: Uses event mutexes lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.134303Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.134305Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3 lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.134306Z 0 [Note] InnoDB: Using Linux native AIO lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.134586Z 0 [Note] InnoDB: Number of pools: 1 lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.134962Z 0 [Note] InnoDB: Using CPU crc32 instructions lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.136240Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.142101Z 0 [Note] InnoDB: Completed initialization of buffer pool lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.143292Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.183384Z 0 [Note] InnoDB: Highest supported file format is Barracuda. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.242543Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.242892Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.310986Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.317119Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.317140Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.317361Z 0 [Note] InnoDB: Waiting for purge to start lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.367892Z 0 [Note] InnoDB: 5.7.18 started; log sequence number 12139694 lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.368297Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.368339Z 0 [Note] Plugin 'FEDERATED' is disabled. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.396380Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.406576Z 0 [Warning] CA certificate ca.pem is self signed. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.408554Z 0 [Note] Server hostname (bind-address): '*'; port: 3306 lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.408580Z 0 [Note] IPv6 is available. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.408586Z 0 [Note] - '::' resolves to '::'; lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.408598Z 0 [Note] Server socket created on IP: '::'. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.409911Z 0 [Note] InnoDB: Buffer pool(s) load completed at 170629 14:49:28 lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.423707Z 0 [Warning] 'user' entry 'root#localhost' ignored in --skip-name-resolve mode. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.423739Z 0 [Warning] 'user' entry 'mysql.sys#localhost' ignored in --skip-name-resolve mode. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.423871Z 0 [Warning] 'db' entry 'sys mysql.sys#localhost' ignored in --skip-name-resolve mode. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.424004Z 0 [Warning] 'proxies_priv' entry '# root#localhost' ignored in --skip-name-resolve mode. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.442753Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys#localhost' ignored in --skip-name-resolve mode. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.524101Z 0 [Note] Event Scheduler: Loaded 0 events lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.524336Z 0 [Note] mysqld: ready for connections. lampstack_db.1.wgofhqdl1v33#moby | Version: '5.7.18' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL) lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.524369Z 0 [Note] Executing 'SELECT * FROM INFORMATION_SCHEMA.TABLES;' to get a list of tables using the deprecated partition engine. You may use the startup option '--disable-partition-engine-check' to skip this check. lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.524372Z 0 [Note] Beginning of list of non-natively partitioned tables lampstack_db.1.wgofhqdl1v33#moby | 2017-06-29T14:49:28.641848Z 0 [Note] End of list of non-natively partitioned tables
I had the same issue running linux containers on a windows machine when I created the secret inline. echo mypassword | docker secret create mysql_db_root - The actual password gets saved with a space, carriage return, and new line at the end. This can be seen if you look at the bytes in the file. In the running mysql container you can use the od command like the following example below to view the bytes. Or outside the container you can dump the /run/secrets/mysql_db_root content to a file and view with your favorite hex editor on windows to see the added bytes. od -xa /run/secrets/mysql_db_root To resolve the issue create the secret by putting it in a file and then using the file to generate the docker secret. See the mysql github issue for more details. docker secret create mysql_db_root mypasswordfile.txt
Docker: Unable to connect to container from host
I try to use docker-compose in order to run an app which consists of 2 container: akka app and postgresql. Here is yaml file: version: "3" services: api: image: akka-app:latest ports: - "9000:5000" db: image: postgres-db:latest After the docker-compose up command I see that containers are up and running using docker ps command: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 65326e5a9677 akka-app:latest "java -cp /..." 40 minutes ago Up 23 seconds 0.0.0.0:9000->5000/tcp samplecompose_api_1 1f86273c4f9a postgres-db:latest "docker-ent..." 19 hours ago Up 23 seconds 5432/tcp samplecompose_db_1 But when I try to access the akka-app from the host via the GET request to 0.0.0.0:9000/status or localhost:9000/status I get back "refused to connect" error in the postman. Extra information: Docker version 17.06.0-ce, build 02c1d87 docker-compose version 1.14.0, build c7bdf9e MacOS Sierra 10.12.5 Network settings of the akka-app container: "NetworkSettings": { "Bridge": "", "SandboxID": "5b5b322ffb0fb881317f8cb4e69b8fd887566b8c5b73940174aabace35d816f8", "HairpinMode": false, "LinkLocalIPv6Address": "", "LinkLocalIPv6PrefixLen": 0, "Ports": { "5000/tcp": [ { "HostIp": "0.0.0.0", "HostPort": "9000" } ] }, "SandboxKey": "/var/run/docker/netns/5b5b322ffb0f", "SecondaryIPAddresses": null, "SecondaryIPv6Addresses": null, "EndpointID": "", "Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "IPAddress": "", "IPPrefixLen": 0, "IPv6Gateway": "", "MacAddress": "", "Networks": { "pinpointcompose_default": { "IPAMConfig": null, "Links": null, "Aliases": [ "api", "65326e5a9677" ], "NetworkID": "925c8379c6d5b334177d7d198d1d38e29983903474183bee5734df9d30ab9810", "EndpointID": "c7c37f545b00c6a19863315858e93a79f10b54b5675dc2cb8704d2f2f9b2bb1c", "Gateway": "172.18.0.1", "IPAddress": "172.18.0.2", "IPPrefixLen": 16, "IPv6Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "MacAddress": "02:42:ac:12:00:02" } } } UPDATE: docker-compose output: docker-compose up Starting samplecompose_api_1 ... Starting samplecompose_api_1 Starting samplecompose_db_1 ... Starting samplecompose_api_1 ... done Attaching to samplecompose_db_1, samplecompose_api_1 db_1 | LOG: database system was shut down at 2017-07-06 08:54:56 UTC db_1 | LOG: MultiXact member wraparound protections are now enabled api_1 | 09:04:26.030 [default-akka.actor.default-dispatcher-3] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started api_1 | 09:04:27.472 [default-akka.actor.default-dispatcher-4] INFO sample-service - Bound to /0.0.0.0:5000
The problem was in an old VirtualBox installed who knows when on my laptop. So while it was installed I could not access running docker containers via localhost... You can read more about this on official docker site After I uninstalled the VirtualBox from the laptop, then restarted the Docker app and relaunched the terminal sessions it was unreal to use localhost for access to the containers. Instead of the localhost I used the IP which I got from the docker-machine ip default. But this is not the good way. So ensure once again that you meet all of the requirements.