Docker delete container after running

When you run a docker image, it create a container and run it. After docker container stop, container stays, so you can use it again if required.

Some times, you need to delete docker container after it is run. This is useful if your docker container is just a command line executable. In my case, docker container have ffmpeg in it, i don’t want container left over after i executed ffmpeg command.

To auto delete container after execution, use –rm option.

Example

apt force IPv4

One of my internet provider only provide IPv4 connection. When i run apt install command, it failed with error as it try to connect using IPv6.

To force apt to use IPv4 only, edit

Add

If you want to force IPv6, add

CentOS 7 resolv.conf make changes permanent

On rebooting CentOS 7 server, changes made to resolv.conf is lost. This is becaise one of the network interface is configured to use DNS server.

To fix, edit

Remove the line

Now NetworkManager will not modify /etc/resolv.conf file on boot.

Or you can set valid DNS servers in network config file like

If your network configuration use DHCP, set set PEERDNS=no.

Another solution is to make file immutable with

Related Posts

Domain Resolver

MariaDB

Ubuntu 18.04 MariaDB 10.2 Too many open files

On my computer running Ubuntu 18.04, MriaDB stopped working. PHP application i run on my computer failed with error

Application can’t find the table. So i tried to login to MySQL and see if table is there or not. But i get error

Next i checked if this is due to any MySQL upgrade. I found MySQL got updated today

To fix this error, run

This wil open a text editor. Add following

Save and quit the editor. Restart MaraDB with

MySQL will work properly now. systemctl edit mysql will create file /etc/systemd/system/mysql.service.d/override.conf

OpenLiteSpeed Benchmark

OpenLiteSpeed

OpenLiteSpeed is open source version of popular commercial web server LiteSpeed. OpenLiteSpeed contains all of the essential features found in LiteSpeed Enterprise.

You can get OpenLiteSpeed from

https://openlitespeed.org

Here is a benchmark from OpenLiteSpeed web site that compare OpenLiteSpeed with Nginx.

OpenLiteSpeed Benchmark

OpenLiteSpeed configuration file

To start/stop/restart, use

OpenLiteSpeed web server stores cache in directory /usr/local/lsws/cachedata. This can grow big overtime. You can delete this folder to free up space or move it to another partition with free disk space and create a symlink.

Web Server