Why docker container update is not stable? - docker

I use the command docker container update --cpus 1 target_container to update the setting. But in most cases it not working and response "you must provide one or more flags when using this command", but somethings it working
Any one know the reason?
Some log is like,
$ docker container update --cpus 0.5 target_container
you must provide one or more flags when using this command
$ docker container update --cpus 0.5 target_container
you must provide one or more flags when using this command
$ docker container update --cpus 0.5 target_container
target_container
the docker version is
Client:
Version: 18.09.7
API version: 1.39
Go version: go1.10.4
Git commit: 2d0083d
Built: Fri Aug 16 14:19:38 2019
OS/Arch: linux/amd64
Experimental: false
Server:
Engine:
Version: 18.09.7
API version: 1.39 (minimum version 1.12)
Go version: go1.10.4
Git commit: 2d0083d
Built: Thu Aug 15 15:12:41 2019
OS/Arch: linux/amd64
Experimental: false

The docker update man page includes:
--cpus API 1.29+
A docker version can show you if your API is equal or above the API 29, which was with Docker 17.05.
For testing, try --cpus=1 or --cpus=0.5, considering the argument is supposed to be "number of CPUs"
As usual with commands including an hyphen: don't copy-paste it, copy it manually.

Related

Docker cannot access any Internet URL during build

I have the following Dockerfile:
FROM mcr.microsoft.com/windows/servercore:ltsc2019
SHELL ["powershell", "-Command"]
RUN Invoke-WebRequest -UseBasicParsing http://www.google.com
On my Windows 10 machine, I run docker build . and get the following:
Basically, Docker is unable to access any Internet URL I try. I can run the same Dockerfile on my Windows Server 2019 Core machine and everything works fine. I'm running Docker version 18.09.2 and haven't updated it recently. This was working a few days ago, so it's a new issue. I've tried restarting the Docker engine and also rebooting. I've also tried a docker system prune. Any ideas what broke this? I'd rather not reinstall Docker if possible.
Docker Info:
Client: Docker Engine - Community
Version: 18.09.2
API version: 1.39
Go version: go1.10.8
Git commit: 6247962
Built: Sun Feb 10 04:12:31 2019
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.2
API version: 1.39 (minimum version 1.24)
Go version: go1.10.6
Git commit: 6247962
Built: Sun Feb 10 04:28:48 2019
OS/Arch: windows/amd64
Experimental: false
Update: Seems to be DNS related. I can ping things.
This is a known issue with ltsc2019 images (https://github.com/Azure/AKS/issues/1029). Put following at the start of your dockerfile or before entrypoint
Set-DnsClientServerAddress -InterfaceIndex (Get-NetAdapter).IfIndex -ServerAddresses ('8.8.8.8')

Why is docker images list empty?

I'm trying to see a list of images in my docker instance, but I keep getting an empty list.
I run
docker run busybox:latest echo hello
It prints hello. I run
docker images list --all
it prints
REPOSITORY TAG IMAGE ID CREATED SIZE
The same thing happens if I try docker load -i myimage.tar and list. Why isn't it showing any images?
docker version
Client:
Version: 17.06.1-ce
API version: 1.30
Go version: go1.8.3
Git commit: 874a737
Built: Thu Aug 17 22:51:12 2017
OS/Arch: linux/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:50:04 2017
OS/Arch: linux/amd64
Experimental: false
Try
docker images
I think the docker client is trying to filter by token list and therefore is not finding any images with this name criteria.
docker images - Will list all the images.
docker image ls - is same as "docker images"
docker images ls - here "ls" acts as filter.
Another alternative answer is to enter docker image ls

Modifying Docker Images Directly

i'm new to docker. I run docker "natively" from a Windows server 2016 with a Windows container, there is no intermediate VM (no docker machine) in between and no docker toolbox, so the "host" is the actual Windows Server that I run docker on.
Docker version:
PS C:> docker version
Client:
Version: 17.03.1-ee-3
API version: 1.27
Go version: go1.7.5
Git commit: 3fcee33
Built: Thu Mar 30 19:31:22 2017
OS/Arch: windows/amd64
Server:
Version: 17.03.1-ee-3
API version: 1.27 (minimum version 1.24)
Go version: go1.7.5
Git commit: 3fcee33
Built: Thu Mar 30 19:31:22 2017
OS/Arch: windows/amd64
Experimental: false
PS C:\>
i pulled the image from docker hub. I need to replace the files inside the docker image while running and commit changes to the image.
Lets say i have Sample.java and datafile.properties inside the docker image which i pulled from docker hub.
i want to replace that with Hello.java and data.properties[ i pulled these files from github]
how would i do that in an automated way? Any advise and some examples on this would he helpful. Thanks in advance.

unable to find the /etc/default/docker with latest docker 17.03.0-ce

I have installed latest docker version 17.03.0-ce in centos 7 and please find the docker version details below,
Client:
Version: 17.03.0-ce
API version: 1.26
Go version: go1.7.5
Git commit: 3a232c8
Built: Tue Feb 28 08:10:07 2017
OS/Arch: linux/amd64
Server:
Version: 17.03.0-ce
API version: 1.26 (minimum version 1.12)
Go version: go1.7.5
Git commit: 3a232c8
Built: Tue Feb 28 08:10:07 2017
OS/Arch: linux/amd64
Experimental: false
I need to do an multi-host networking using swarm and i was following this link Lab 06: Docker Networking
They have mentioned to edit /etc/default/docker file to comment out DOCKER_OPTS value. But i couldnt see any file in my host machine. Where could i find this file to change the value of DOCKER_OPTS
The guide is for debian based systems that use /etc/default in Redhat based systems use:
/etc/sysconfig
in your case:
/etc/sysconfig/docker
You can edit the systemd unit file directly for your purpose, but its not recommended.

Docker can create a new swarm

I am using the docker docs to create a swarm
https://docs.docker.com/engine/swarm/swarm-tutorial/create-swarm/
[centos#dsm-manager1 ~]$ docker swarm init --advertise-addr 10.192.10.220
Error response from daemon: --live-restore daemon configuration is incompatible with swarm mode
[centos#dsm-manager1 ~]$
The version of docker I'm using
[centos#dsm-manager1 ~]$ docker version
Client:
Version: 1.12.6
API version: 1.24
Package version: docker-common-1.12.6-11.el7.centos.x86_64
Go version: go1.7.4
Git commit: 96d83a5/1.12.6
Built: Tue Mar 7 09:23:34 2017
OS/Arch: linux/amd64
Server:
Version: 1.12.6
API version: 1.24
Package version: docker-common-1.12.6-11.el7.centos.x86_64
Go version: go1.7.4
Git commit: 96d83a5/1.12.6
Built: Tue Mar 7 09:23:34 2017
OS/Arch: linux/amd64
The doc version is 1.17,I don't know whether this matters,
I just can't find the doc about swarm mode in version 1.12
For those who can’t find /etc/docker/daemon.json try /etc/sysconfig/docker
live-restore option is there:
OPTIONS=’–selinux-enabled --log-driver=journald --live-restore’

Resources