While trying to run the next Docker command:
docker run \
--net=host \
--pid=host \
--privileged=true \
-d \
gcr.io/google_containers/hyperkube-amd64:v1.7.0 \
/nsenter \
--target=1 \
--mount \
--wd=. \
-- ./hyperkube kubelet \
--hostname-override="127.0.0.1" \
--address="0.0.0.0" \
--api-servers=http://localhost:8080 \
--config=etc/kubernetes/manifests \
--v=2
I am getting an error
nsenter: failed to execute ./hyperkube: No such file or directory
I have been trying a lot of combination, but nothing seems to work, have someone else tried to do this before?
My docker version is
Client:
Version: 1.12.6
API version: 1.24
Go version: go1.6.4
Git commit: 78d1802
Built: Wed Jan 11 00:23:16 2017
OS/Arch: darwin/amd64
Server:
Version: 1.12.6
API version: 1.24
Go version: go1.6.4
Git commit: 78d1802
Built: Wed Jan 11 00:23:16 2017
OS/Arch: linux/amd64
Thanks
kubernetes doesn't support Docker 17.06. Try Docker 1.12.6 instead.
I found the solution!
Hyperkube is not designed to run in macOS so i had to use other kind of kubernetes server for local development and that work perfectly:
I am currently using kubeadm-dind-cluster
Related
The problem
In a docker container i want to download some packages with nuget. These packages size is around 5 GB. After downloading them they will be unpackaged in a mounted folder, for later use.
When doing this nuget returns an error saying "disk full", although there is several 100GB of space left on the host.
Doing the same thing on windows and linux works fine.
The container is not started with docker run, but with docker compose run.
What I've tried
docker system prune -a
Restart docker
Increase the memory in the docker preferences to 8GB
Increase the SWAP size to the maximum (4GB is the max)
My current docker settings
Docker version
Client:
Cloud integration: v1.0.22
Version: 20.10.12
API version: 1.41
Go version: go1.16.12
Git commit: e91ed57
Built: Mon Dec 13 11:46:56 2021
OS/Arch: darwin/amd64
Context: default
Experimental: true
Server: Docker Desktop 4.5.0 (74594)
Engine:
Version: 20.10.12
API version: 1.41 (minimum version 1.12)
Go version: go1.16.12
Git commit: 459d0df
Built: Mon Dec 13 11:43:56 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.12
GitCommit: 7b11cfaabd73bb80907dd23182b9347b4245eb5d
runc:
Version: 1.0.2
GitCommit: v1.0.2-0-g52b36a2
docker-init:
Version: 0.19.0
GitCommit: de40ad0
Docker compose yaml
version: "3.3"
services:
nuget:
build:
context: docker_image
args:
BASE_IMAGE: "ubuntu:20.04"
image: nuget
volumes:
- /var/cache/nuget/v3-cache:/root/.local/share/NuGet/v3-cache
- /var/cache/nuget/packages:/root/.nuget/packages
- /tmp:/nuget_cache
working_dir: /nuget_cache
environment:
- NEXUS_PASSWORD
- PACKAGES
- USER=${USER}
command:
- /fetch.sh
Fetch script in the image
mono /nuget.exe sources add \
-NonInteractive -Verbosity detailed \
-name PackageSource_0 \
-configfile cfg.xml \
-source <my_source> \
-username ovation-tests -password "${NEXUS_PASSWORD}"
for pkg in ${PACKAGES};
do
echo "Installing ${pkg}..."
mono /nuget.exe install "${pkg}" \
-NonInteractive -Verbosity detailed \
-packagesavemode nuspec \
-OutputDirectory . \
-ConfigFile cfg.xml \
-source PackageSource_0
done
I've installed docker in windows 10 successfully.
I can run docker version and see this result
$ docker version
Client: Docker Engine - Community
Cloud integration: 1.0.4
Version: 20.10.0
API version: 1.41
Go version: go1.13.15
Git commit: 7287ab3
Built: Tue Dec 8 18:55:31 2020
OS/Arch: windows/amd64
Context: myacicontext
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.0
API version: 1.41 (minimum version 1.24)
Go version: go1.13.15
Git commit: eeddea2
Built: Tue Dec 8 19:07:44 2020
OS/Arch: windows/amd64
Experimental: false
but when I run $ docker images I receive this error
unknown command "images" for "docker"
The problem is that you're not in the right context.
From your logs I can see that you're in the "acicontext" where the $ docker images command is not available. I had the same issue when I tried to deploy a container to Azure.
To resolve this, first, run the command $ docker context list in Powershell. You should be seeing a list of contexts and the one that you're on has a star right next to its name like so :
If you want to be able to use the $ docker images command you have to go inside the right context, which in this example is "default". To do so, run $ docker context use default
Then run $ docker images again, it should be working.
You can read more about Docker context here https://docs.docker.com/engine/context/working-with-contexts/
I had the same issue, and I had to uninstall and reinstall, wich
When trying to run my docker file. I get the following error.
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"rootfs_linux.go:58: mounting \\\"/Users/hkatyal/go/src/github.com/purser/bin/amd64\\\" to rootfs \\\"/var/lib/docker/overlay2/c144a9b95f53811b456c7a4e84064bf4231a2a94afcf2c77b8c6d031c3f4bf87/merged\\\" at \\\"/var/lib/docker/overlay2/c144a9b95f53811b456c7a4e84064bf4231a2a94afcf2c77b8c6d031c3f4bf87/merged/go/bin/linux_amd64\\\" caused \\\"mkdir /var/lib/docker/overlay2/c144a9b95f53811b456c7a4e84064bf4231a2a94afcf2c77b8c6d031c3f4bf87/merged/go/bin/linux_amd64: permission denied\\\"\"": unknown.
My Docker Cmd is as follows:
#docker run \
-ti \
-u $$(id -u):$$(id -g) \
-v $$(pwd)/.go:/go:$(DOCKER_MOUNT_MODE) \
-v $$(pwd)/$(BUILD):/go/src/$(PRO)/$(BUILD):$(DOCKER_MOUNT_MODE) \
-v $$(pwd)/$(CMD):/go/src/$(PRO)/$(CMD):$(DOCKER_MOUNT_MODE) \
-v $$(pwd)/$(PKG):/go/src/$(PRO)/$(PKG):$(DOCKER_MOUNT_MODE) \
-v $$(pwd)/$(DEP):/go/src/$(PRO)/$(DEP):$(DOCKER_MOUNT_MODE) \
-v $$(pwd)/bin/$(ARCH):/go/bin:$(DOCKER_MOUNT_MODE) \
-v $$(pwd)/bin/$(ARCH):/go/bin/linux_$(ARCH):$(DOCKER_MOUNT_MODE) \
-v $$(pwd)/.go/std/$(ARCH):/usr/local/go/pkg/linux_$(ARCH)_static:$(DOCKER_MOUNT_MODE) \
-w /go/src \
golang:1.11 \
/bin/sh -c " \
ARCH=$(ARCH) \
VERSION=$(VERSION) \
PKG=$(PKG) \
./$(PRO)/$(BUILD)/build.sh \
"
This issue is coming in Mac working fine for Linux. Do I need to change some settings?
Environment Details as follows:
macOS Version: 10.13.6
Docker Version:
$ 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: true
The problem is that the Mac machine isn't a real Docker host and Docker on Mac runs on the VM and the Docker volumes are not in the path.
Details here.
I just got a new Mac. My old Mac had a shell script that included these lines:
ACTIVE=`docker-machine active 2>/dev/null`
HOST_IP=`docker-machine ip $ACTIVE`
When I run this on the new machine it doesn't work. Just running the docker-machine active command independently I get output like this:
No active host found
I figured I try to create a default with docker-machine create default, but got this:
dial-http tcp 127.0.0.1:49719: unexpected EOF
I'm not sure what version of Docker my old Mac was running, but it was native. New Mac:
Client:
Version: 17.06.1-ce
API version: 1.30
Go version: go1.8.3
Git commit: 874a737
Built: Thu Aug 17 22:53:38 2017
OS/Arch: darwin/amd64
Server:
Version: 17.06.1-ce
API version: 1.30 (minimum version 1.12)
Go version: go1.8.3
Git commit: 874a737
Built: Thu Aug 17 22:54:55 2017
OS/Arch: linux/amd64
Experimental: true
New versions of Docker for Mac no longer user VirtualBox and docker-machine. It's running on xhyve and you can run docker commands very similar to if you were running docker natively on a linux host. There's still a VM under the covers (using moby), but your scripts shouldn't see that anymore. Anything you use to connect to published ports can now connect to localhost as if it is running directly on the Mac host.
I'm creating a Docker container with the following command:
docker run -v /data -d ubuntu
Afterwards I try to find out the real location of the volume with:
docker inspect 12345678
and it shows that it's in /var/lib/docker/volumes/0ef2ed2715456b767fe52d38a316074c3da4a6fa82e4e42e5595c8dd8b5f0440/_data
ls: /var/lib/docker/volumes/0ef2ed2715456----/_data:
But I don't actually have a /var/lib/docker directory.
What am I missing?
I'm using Docker 1.12 on Mac.
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 on Mac runs a docker engine in a Linux VM, not your Mac OS, so you can't find the volume's mount point in your Mac OS file system. Please check my answer in this question: Docker Named Volume location Mac