Limit systemd service memory for docker - systemd

I've got a very wierd problem with docker.service. I try to limit memory using that MemoryLimit=8Gbut when I do that containers won't to start after service restart. Other limitatnions which I use works fine:
CPUWeight=60
CPUQuota=80%
IOWeight=20
MemorySwapMax=1
Some details:
Version: 19.03.8
API version: 1.40
Go version: go1.12.17
Git commit: afacb8b7f0
Built: Wed Mar 11 01:25:46 2020
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.8
API version: 1.40 (minimum version 1.12)
Go version: go1.12.17
Git commit: afacb8b7f0
Built: Wed Mar 11 01:24:19 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.2.13
GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683
system: Ubuntu 18 LTS (5.0.0-1032-azure)

Related

Does Ubuntu 22.04 offer a recent version of Maven

I just upgraded Ubuntu from 18.04 to 22.04 and when I run mvn --version is still see:
Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 11.0.15, vendor: Private Build, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.15.0-1013-aws", arch: "amd64", family: "unix"
which is almost a 2 years old version.
I would like to avoid a manual install and keep using apt to manage the installation of maven. Am I asking for too much or did I miss something?
Running Ubuntu 22.10:
mvn -v
Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 17.0.4, vendor: Private Build, runtime: /usr/lib/jvm/java-17-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.19.0-15-generic", arch: "amd64", family: "unix"

Ansible ansible.builtin.url module "Name does not resolve" error

I am trying to use the ansible.builtin.url module to fetch the contents of a remote file on my remote server. I am using one of the examples in the official documentation page of the module, but occasionally I am getting the Name does not resolve error. I am saying occasionally because this behaviour is not consistent. Sometimes I get the results, sometimes I get the error...
How do you suggest I debug this error?
Ansible task
- name: url lookup splits lines by default
debug: msg="{{item}}"
loop: "{{ lookup('url', 'https://ip-ranges.amazonaws.com/ip-ranges.json', wantlist=True) }}"
Playbook output
TASK [url lookup splits lines by default] *********************************************************************************************
fatal: [my.domain.name]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'url'. Error was a <class 'ansible.errors.AnsibleError'>, original message: Failed lookup url for https://ip-ranges.amazonaws.com/ip-ranges.json : <urlopen error [Errno -2] Name does not resolve>"}
Ansible version
$ ansible --version
ansible 2.10.2
config file = /etc/ansible/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.8/site-packages/ansible
executable location = /usr/bin/ansible
python version = 3.8.6 (default, Oct 5 2020, 00:23:48) [GCC 10.2.0]
Python packages versions
$ pip3 list
Package Version
---------------------- --------------------
appdirs 1.4.3
attrs 19.3.0
Automat 0.8.0
blinker 1.4
certifi 2019.11.28
chardet 3.0.4
Click 7.0
cloud-init 20.3
colorama 0.4.3
command-not-found 0.3
configobj 5.0.6
constantly 15.1.0
cryptography 2.8
dbus-python 1.2.16
distlib 0.3.0
distro 1.4.0
distro-info 0.23ubuntu1
entrypoints 0.3
fail2ban 0.11.1
filelock 3.0.12
httplib2 0.14.0
hyperlink 19.0.0
idna 2.8
importlib-metadata 1.5.0
incremental 16.10.1
Jinja2 2.10.1
jsonpatch 1.22
jsonpointer 2.0
jsonschema 3.2.0
keyring 18.0.1
language-selector 0.1
launchpadlib 1.10.13
lazr.restfulclient 0.14.2
lazr.uri 1.0.3
MarkupSafe 1.1.0
more-itertools 4.2.0
netifaces 0.10.4
oauthlib 3.1.0
pexpect 4.6.0
pip 20.0.2
pyasn1 0.4.2
pyasn1-modules 0.2.1
PyGObject 3.36.0
PyHamcrest 1.9.0
pyinotify 0.9.6
PyJWT 1.7.1
pymacaroons 0.13.0
PyNaCl 1.3.0
pyOpenSSL 19.0.0
pyrsistent 0.15.5
pyserial 3.4
python-apt 2.0.0+ubuntu0.20.4.1
python-debian 0.1.36ubuntu1
PyYAML 5.3.1
requests 2.22.0
requests-unixsocket 0.2.0
SecretStorage 2.3.1
service-identity 18.1.0
setuptools 45.2.0
simplejson 3.16.0
six 1.14.0
sos 4.0
ssh-import-id 5.10
systemd-python 234
Twisted 18.9.0
ubuntu-advantage-tools 20.3
ufw 0.36
unattended-upgrades 0.1
urllib3 1.25.8
virtualenv 20.0.17
wadllib 1.3.3
wheel 0.34.2
zipp 1.0.0
zope.interface 4.7.1
PS: Running dig ip-ranges.amazonaws.com on the target machine returns this output:
$ dig ip-ranges.amazonaws.com
; <<>> DiG 9.16.1-Ubuntu <<>> ip-ranges.amazonaws.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16015
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;ip-ranges.amazonaws.com. IN A
;; ANSWER SECTION:
ip-ranges.amazonaws.com. 900 IN CNAME d3mduebighmd0u.cloudfront.net.
d3mduebighmd0u.cloudfront.net. 59 IN A 13.224.93.97
d3mduebighmd0u.cloudfront.net. 59 IN A 13.224.93.6
d3mduebighmd0u.cloudfront.net. 59 IN A 13.224.93.36
d3mduebighmd0u.cloudfront.net. 59 IN A 13.224.93.58
;; Query time: 40 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Thu Nov 19 11:42:03 UTC 2020
;; MSG SIZE rcvd: 159
The problem had to do with the OS version the controller was running. Changing it from alpine:edge to alpine:3.12.1 fixed the problem. This issue helped: https://github.com/gliderlabs/docker-alpine/issues/539

while deploying spring boot application on docker i am getting this error

this is my docker details.
Client: Docker Engine - Community
Version: 19.03.8
API version: 1.40
Go version: go1.12.17
Git commit: afacb8b
Built: Wed Mar 11 01:23:10 2020
OS/Arch: windows/amd64
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 19.03.8
API version: 1.40 (minimum version 1.24)
Go version: go1.12.17
Git commit: afacb8b
Built: Wed Mar 11 01:37:20 2020
OS/Arch: windows/amd64
Experimental: true

linking against openssl 1.0.0 when run ansible-playbook

after installed ansible on a redhat linux machine(kernel version unknown)
when run ansible-playbook I got such error.
RuntimeError: You are linking against OpenSSL 1.0.0, which is no longer support by the OpenSSL project. You need to upgrade to a newer version of OpenSSL
my python version is: Python 2.7.10
ansible: 2.1.0.0
ssh version: OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010
I tried upgrade openssl to fix this. But not work.
Finally, I also upgrade openssh, and fix this.
fixed version:
openssl: OpenSSL 1.0.1e-fips 11 Feb 2013
openssh: OpenSSH_6.9p1, OpenSSL 1.0.1e-fips 11 Feb 2013
Hope this will help for you too.

docker: 'network' is not a docker command

I have recently installed docker in aws ec2 instance by using the command
$ yum install docker
But when I try to run $ docker network --help it says
docker: 'network' is not a docker command.
Please let me know what is the issue here.
Here is the output of docker version
Client version: 1.7.1
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 786b29d/1.7.1
OS/Arch (client): linux/amd64
Server version: 1.7.1
Server API version: 1.19
Go version (server): go1.4.2
Git commit (server): 786b29d/1.7.1
OS/Arch (server): linux/amd64
From the docker engine release notes I see in docker 1.9
docker network exits experimental and is part of standard release (#16645)
so docker 1.7.1 seems a bit too old to support docker network.
Amazon Linux AMI has only docker 1.7.1 in its latest release 2015.09, which means it you need and try to install the latest docker yourself.

Resources