Enable Docker Remote API in Redhat 7 (CentOS 7)

Tried different ways to enable the Remote API, never get any luck on anything…

But finally, here is what I did, that works!

vi /etc/sysconfig/docker

Here is my docker content:

# Modify these options if you want to change the way the docker daemon runs
OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false'
if [ -z "${DOCKER_CERT_PATH}" ]; then
# Do not add registries in this file anymore. Use /etc/containers/registries.conf
# from the atomic-registries package.
# docker-latest daemon can be used by starting the docker-latest unitfile.
# To use docker-latest client, uncomment below lines
Add '-H tcp:// -H unix:///var/run/docker.sock' in the 'OPTIONS':
OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false -H tcp:// -H unix:///var/run/docker.sock'
Then restart your docker daemon by systemctl restart docker
Done~ This only enables the local port, so it's secure for testing purpose.