Docker build crashes whole machine when transferring build context - laravel

My machine crashes when I try to build an docker image. I can only build once and then the machine crashes when I try to start a second build.
It always starts and then starts to transfer to the build context, and around the 150-170mb mark it locks up the machine needing a restart to get it back.
I have not been able to find any logs regarding to any errors so I am completely in the dark.
I am running Ubuntu 22.04.1 LTS
In the codeblock below you can find the system specifications
docker info output:
Client:
Context: default
Debug Mode: false
Plugins:
app: Docker App (Docker Inc., v0.9.1-beta3)
buildx: Docker Buildx (Docker Inc., v0.9.1-docker)
compose: Docker Compose (Docker Inc., v2.10.2)
scan: Docker Scan (Docker Inc., v0.17.0)
Server:
Containers: 13
Running: 0
Paused: 0
Stopped: 13
Images: 189
Server Version: 20.10.18
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runtime.v1.linux runc io.containerd.runc.v2
Default Runtime: runc
Init Binary: docker-init
containerd version: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
runc version: v1.1.4-0-g5fd4c4d
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: default
cgroupns
Kernel Version: 5.15.0-47-generic
Operating System: Ubuntu 22.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 12 (Added by Author: Model Intel Core i5-11400H)
Total Memory: 15.36GiB
Name: SHENZHOU
ID: RA4Z:367M:Z7EV:ODMX:IT5C:ZARV:NAAO:KZHX:D3VN:544G:UWA7:U27Q
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

Related

GitHub action pullling windows image

Using windows-latest runner I was not able to pull a windows docker image.
Setup
yaml file
name: Docker
on: [push, pull_request]
jobs:
Windows:
runs-on: windows-latest
steps:
- uses: actions/checkout#v2
- name: docker version
run: docker version
- name: docker info
run: docker info
- name: Pull image
run: docker pull mcr.microsoft.com/windows:2009
- name: Build image
run: docker build -f win.Dockerfile .
Dockerfile
# Create a virtual environment with all tools installed
# ref: https://hub.docker.com/_/microsoft-windows
FROM mcr.microsoft.com/windows:2009 AS env
RUN Get-ChildItem Env:
RUN cmake -version
src: https://github.com/Mizux/inspect-ci
Observed
$ docker version
Client: Docker Engine - Enterprise
Version: 19.03.12
API version: 1.40
Go version: go1.13.13
Git commit: 4306744
Built: 08/05/2020 19:27:53
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Enterprise
Engine:
Version: 19.03.12
API version: 1.40 (minimum version 1.24)
Go version: go1.13.13
Git commit: f295753ffd
Built: 08/05/2020 19:26:41
OS/Arch: windows/amd64
Experimental: false
$ docker info
Client:
Debug Mode: false
Plugins:
cluster: Manage Docker Enterprise clusters (Mirantis Inc., v1.6.0)
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 5
Server Version: 19.03.12
Storage Driver: windowsfilter
Windows:
Logging Driver: json-file
Plugins:
Volume: local
Network: ics internal l2bridge l2tunnel nat null overlay private transparent
Log: awslogs etwlogs fluentd gcplogs gelf json-file local logentries splunk syslog
Swarm: inactive
Default Isolation: process
Kernel Version: 10.0 17763 (17763.1.amd64fre.rs5_release.180914-1434)
Operating System: Windows Server 2019 Datacenter Version 1809 (OS Build 17763.1518)
OSType: windows
Architecture: x86_64
CPUs: 2
Total Memory: 7GiB
Name: fv-az68-962
ID: 7OIU:P7VO:DVY5:6QUE:34MP:ZFAE:EN7P:4BVA:3MEH:G5VM:ZVMS:LAND
Docker Root Dir: C:\ProgramData\docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
$ docker pull mcr.microsoft.com/windows:2009
no matching manifest for windows/amd64 10.0.17763 in the manifest list entries
Since it is a runner, it's headless so please don't ask me to "click" on system tray...
ref:
https://hub.docker.com/_/microsoft-windows
https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
The base image you are requesting (mcr.microsoft.com/windows:2009) is not compatible with underlying Docker backend pre-installed on windows-latest runners. If you look at docker version/info output you can see those values:
OS/Arch: windows/amd64
Kernel Version: 10.0 17763 (17763.1.amd64fre.rs5_release.180914-1434)
This is why you get the error:
no matching manifest for windows/amd64 10.0.17763 in the manifest list entries
You should switch to a compatible base image to fix it. You can find one at https://hub.docker.com/_/microsoft-windows. Navigate to §Full Tag Listing section and inspect the Architecture and OsVersion column to find the matching image tag to switch to (eg.: mcr.microsoft.com/windows:10.0.17763.1518).

Cannot connect to the Docker daemon at unix:///var/run/docker.sock on OSX

I've created a Scala project that creates a testcontainer (via com.dimafeng.testcontainers) with two Docker's containers (singularities/datastore-emulator and bigtruedata/gcloud-pubsub-emulator). The testcontainer is successfully created, when I run the docker ps command this is what I see:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ddc16471205a quay.io/testcontainers/ryuk:0.2.2 "/app" 2 minutes ago Up 2 minutes 0.0.0.0:32771->8080/tcp testcontainers-ryuk-371a41c2-3d23-426f-943d-608a816c96d3
Now, the problem occurs when I try to run the container:
$ docker run -p 4000:80 quay.io/testcontainers/ryuk:0.2.2
2018/12/13 10:59:48 Starting on port 8080...
panic: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
goroutine 1 [running]:
main.main()
/go/src/github.com/bsideup/moby-ryuk/main.go:31 +0xe2e
And if I go inside the container and run the /app command this is what I get:
$ docker exec -it ddc /bin/sh
/ # /app
2018/12/13 11:40:55 Starting on port 8080...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x64f8d6]
goroutine 9 [running]:
main.main.func1(0xc4200685a0, 0xc4201bd890, 0xc420068600)
/go/src/github.com/bsideup/moby-ryuk/main.go:42 +0x286
created by main.main
/go/src/github.com/bsideup/moby-ryuk/main.go:39 +0x1b5
I've tried literally everything from setting the docker-machine eval default to check all the possible permissions problems. What am I missing?
(I have no access at all to the go files present in the errors)
Here's the information about my docker installation
$ docker version
Client: Docker Engine - Community
Version: 18.09.0
API version: 1.39
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:47:43 2018
OS/Arch: darwin/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.0
API version: 1.39 (minimum version 1.12)
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:55:00 2018
OS/Arch: linux/amd64
Experimental: false
And the infos
$ docker info
Containers: 19
Running: 1
Paused: 0
Stopped: 18
Images: 7
Server Version: 18.09.0
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 4.9.125-linuxkit
Operating System: Docker for Mac
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 1.952GiB
Name: linuxkit-025000000001
ID: 5XHJ:QGZD:4I55:WLU6:RLUF:E5XL:XFUL:PMBB:D432:IJFX:EUPG:QEVW
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: 33
Goroutines: 58
System Time: 2018-12-13T11:34:52.2335167Z
EventsListeners: 2
HTTP Proxy: gateway.docker.internal:3128
HTTPS Proxy: gateway.docker.internal:3129
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine

Creating hardlinks in docker container takes long the first time

I am creating hard links of all the files in a directory (some 500MB) in a docker container using following command:
cp -al source destination
Interestingly, when I issue the above command the first time (i.e. when there is no hardlink for each file in that directory), it takes quite a long time. This is not the case when I issue the above command again to create hardlinks of same files in other destination. This is also not the case when I do that in my docker host (even if it's the first hardlink that is being created).
My docker container uses overlay2 as the storage driver. Here is my docker info output
Containers: 61
Running: 1
Paused: 0
Stopped: 60
Images: 142
Server Version: 1.13.1
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: journald
Cgroup Driver: systemd
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Authorization: rhel-push-plugin
Swarm: inactive
Runtimes: runc oci
Default Runtime: oci
Init Binary: /usr/libexec/docker/docker-init-current
containerd version: fbadd789ddf86a4be9d6905528b7486c61e52612 (expected: aa8187dbd3b7ad67d8e5e3a15115d3eef43a7ed1)
runc version: fbadd789ddf86a4be9d6905528b7486c61e52612-dirty (expected: 9df8b306d01f59d3a8029be411de015b7304dd8f)
init version: N/A (expected: 949e6facb77383876aeff8a6944dde66b3089574)
Security Options:
seccomp
WARNING: You're not using the default seccomp profile
Profile: /etc/docker/seccomp.json
selinux
Kernel Version: 4.14.13-300.fc27.x86_64
Operating System: Fedora 27 (Workstation Edition)
OSType: linux
Architecture: x86_64
Number of Docker Hooks: 3
CPUs: 8
Total Memory: 15.58 GiB
Name: pranavk.local.me
ID: STYG:PZCA:FMHL:FLCU:N7VG:Z463:KYQF:QVHO:KWKP:FHTY:EUBA:QBUK
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Registries: docker.io (secure), registry.fedoraproject.org (secure), registry.access.redhat.com (secure), docker.io (secure)
Edit:
If I remove all the hardlinks and then issue above cp command again, it's fast again. Phew!
I am not sure what's causing this or from where I should start looking from.

Docker swarm manager pending status

I have 2 windows 2016 server with container services enabled. I have installed docker in both the machines.
Now I am trying to install docker cluster swarm mode. But when run:
docker swarm init --advertise-addr 192.168.233.131 > test.txt
it is stuck and does not display any output.
When I run docker info, it showing
Swarm: pending ( manager node).
Kindly help me to resolve. What have I missed?
Containers: 6 Running: 0 Paused: 0 Stopped: 6 Images: 5 Server
Version: 17.03.0-ee-1 Storage Driver: windowsfilter Windows: Logging
Driver: json-file Plugins: Volume: local Network: l2bridge l2tunnel
nat null overlay transparent Swarm: pending NodeID: l0cavlw31jzh4xbg34gqkubah Is Manager: true ClusterID:
bi188mb7kcd0ct87c1ia1xha3 Managers: 1 Nodes: 1 Orchestration:
Task History Retention Limit: 5 Raft: Snapshot Interval: 10000
Number of Old Snapshots to Retain: 0 Heartbeat Tick: 1 Election
Tick: 3 Dispatcher: Heartbeat Period: 5 seconds CA Configuration:
Expiry Duration: 3 months Node Address: 192.168.233.131 Manager
Addresses:
0.0.0.0:2377 Default Isolation: process Kernel Version: 10.0 14393 (14393.1480.amd64fre.rs1_release.170706-2004) Operating System:
Windows Server 2016 Standard OSType: windows Architecture: x86_64
CPUs: 1 Total Memory: 1.999 GiB Name: WIN-NGCG1EF8Q2E ID:
EAT6:KLZD:BQAY:TXGV:4LR4:POTH:3VSJ:OEQO:TBAN:L322:QFNC:4V3J Docker
Root Dir: C:\ProgramData\docker Debug Mode (client): false Debug Mode
(server): false Registry: https://index.docker.io/v1/ Experimental:
false Insecure Registries:
127.0.0.0/8 Live Restore Enabled: false
C:\> docker swarm init --advertise-addr=HOSTIPADDRESS --listen-addr HOSTIPADDRESS:2377
i have typed the above command format it works thanks #Tarun Lalwani

Default docker machine on Mac

I'm a bit confused about the default docker machine on Mac.
Currently, my docker-machine ls shows a machine called default but it's not running. And yet I can still run containers without a problem. I believe what happened was I was having problem with the default setup and I rm and created the default machine. But apparently default is NOT the default machine because when I switch to it with eval $(docker-machine env default) I see completely different images and containers.
What is the default docker machine on Mac?
Here is my versions:
Client:
Version: 1.12.1
API version: 1.24
Go version: go1.7.1
Git commit: 6f9534c
Built: Thu Sep 8 10:31:18 2016
OS/Arch: darwin/amd64
Server:
Version: 1.12.1
API version: 1.24
Go version: go1.6.3
Git commit: 23cf638
Built: Thu Aug 18 17:52:38 2016
OS/Arch: linux/amd64
docker info output:
Containers: 15
Running: 1
Paused: 0
Stopped: 14
Images: 52
Server Version: 1.12.1
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 270
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: host overlay null bridge
Swarm: active
NodeID: exto91f6u59r77znpa3kj9ufp
Is Manager: true
ClusterID: 5my0ngxiaozvdt6s44icecy4y
Managers: 1
Nodes: 1
Orchestration:
Task History Retention Limit: 5
Raft:
Snapshot Interval: 10000
Heartbeat Tick: 1
Election Tick: 3
Dispatcher:
Heartbeat Period: 5 seconds
CA Configuration:
Expiry Duration: 3 months
Node Address: 192.168.65.2
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 4.4.20-moby
Operating System: Alpine Linux v3.4
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.953 GiB
Name: moby
ID: 3QHL:JAAF:XUSR:KR5Q:APNG:Z4LN:XSFR:53YC:6VBQ:DZJE:DM6G:MWXY
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: 38
Goroutines: 128
System Time: 2016-10-23T02:24:34.36197692Z
EventsListeners: 1
Username: yijian
Registry: https://index.docker.io/v1/
Insecure Registries:
127.0.0.0/8
Probably you upgraded to docker for mac which no longer use docker-machine to emulate a docker environment in Mac.
You can still use docker-machine primarily for manage remote docker engines.
Regards

Resources