Skip to content

Blog

Some Operations After Installing Docker and Podman

After installing Docker, there are usually a few follow-up tasks to complete. This note provides an all-in-one reference.

Add the current user to the docker group:

cat /etc/group | grep docker # Check whether the docker group exists
groups # List your user groups and confirm whether you are in the docker group
# If the docker group does not exist, create it:
sudo groupadd docker
# Add the current user to the docker group
sudo gpasswd -a ${USER} docker
# Restart the service
sudo service docker restart
# Switch groups to refresh the cached group list
newgrp - docker;
# Run the commands line by line. In some cases, the second command does not take effect when both are run in a batch.
newgrp - `groups ${USER} | cut -d' ' -f1`;
# Alternatively, log out and log back in
pkill X

Create or edit /etc/docker/daemon.json:

{
"registry-mirrors": [
"https://1nj0zren.mirror.aliyuncs.com",
"https://docker.mirrors.ustc.edu.cn",
"http://f1361db2.m.daocloud.io",
"https://registry.docker-cn.com"
]
}
  • You can replace these mirrors with other available registry mirror addresses.

(2). Configure Podman registry acceleration

Section titled “(2). Configure Podman registry acceleration”

Edit /etc/containers/registries.conf and use the following pattern:

[[registry]]
prefix = "docker.io"
location = "xxxxxxxx.mirror.aliyuncs.com"

3. Change Docker’s default storage location

Section titled “3. Change Docker’s default storage location”

sudo systemctl stop docker

(2). Move the data directory to the target location

Section titled “(2). Move the data directory to the target location”

mv /var/lib/docker/ /home/dockerdata

ln -s /home/dockerdata/ /var/lib/docker

sudo systemctl restart docker

Docker official China mirror: https://registry.docker-cn.com

NetEase: http://hub-mirror.c.163.com

USTC: http://docker.mirrors.ustc.edu.cn

Alibaba Cloud: http://<your ID>.mirror.aliyuncs.com

[1].http://www.markjour.com/article/docker-no-root.html

[2].https://juejin.cn/post/6844903840303546376

[3].https://blog.csdn.net/glongljl/article/details/80158297

[4].https://blog.csdn.net/qq_21933797/article/details/115186907

Build Container Image with Podman

podman build -t TAGS .

  • For docker, just replacepodmanwithdocker.

podman build --platform=linux/arm/v7 -t TAGS . Here we takearm/v7as an example.

3. Push the Image to DockerHubUse the following command, replacingusernameandpasswordwith your actual username and password```

Section titled “3. Push the Image to DockerHubUse the following command, replacingusernameandpasswordwith your actual username and password```”

podman push –creds username:password
docker.io/library/IMAGENAME:latest
docker.io://ACCOUNT/IMAGENAME:latest

## 4. Push after Login```
podman login docker.io
podman push docker.io/library/IMAGENAME:latest

[2]. Container-On-Mikrotik

C Learning Notes

gcc -std=c99 filename.c

c99, c1x, and c11 are examples of available standards.

gcc -o output_file filename.c
gcc filename.c -I/usr/local/include
gcc filename.c -lssl

[1]. gcc-g++参数

[2]. Makefile-初探

[3]. Qmake-Pro

Install the Hexo Environment on Ubuntu

sudo apt-get install npm -y

Enter the blog directory and install Hexo:

sudo npm i hexo-cli -g

Install the required components:

sudo npm install

Check whether Hexo was installed successfully:

hexo -v
hexo new post "__Post_Name"
hexo d -g

[1]. Ubuntu依赖解析和安装

MkDocs on Ubuntu

MkDocs is a opensource framework for static pages, which is developed with python.

Install basic dependencies:

sudo apt install -y --no-install-recommends git git-lfs python3 pip

If you wish to enable social plugin:

sudo apt install -y --no-install-recommends libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev pngquant
pip install pip install --no-cache-dir --break-system-packages \
mkdocs-material \
mkdocs-git-revision-date-localized-plugin \
mkdocs-git-authors-plugin \
mkdocs-rss-plugin \
mkdocs-material[imaging]

Configure this config file.

For detail: Material for MkDocs

Create *.md in folder.

Build your blog with command:

mkdocs build

Deploy your blog with command:

mkdocs gp-deploy

[1]. Ubuntu依赖解析和安装