Answers: <p>It turns out there was a leftover file from a previous version of docker at <code>/etc/systemd/system/docker.service.d/service-overrides.conf</code> that was injecting environment variables into the docker.service ExecStart command.</p>
  <pre><code># cat /etc/systemd/system/docker.service.d/service-overrides.conf
  [Service]
  EnvironmentFile=-/etc/sysconfig/docker
  EnvironmentFile=-/etc/sysconfig/docker-storage
  EnvironmentFile=-/etc/sysconfig/docker-network
  ExecStart=
  ExecStart=/usr/bin/docker daemon $OPTIONS \
        $DOCKER_STORAGE_OPTIONS \
        $DOCKER_NETWORK_OPTIONS \
        $BLOCK_REGISTRY \
        $INSECURE_REGISTRY
  </code></pre>
  <p>I removed this file and rebooted, then docker started successfully.</p>
  
Answers: CC BY-SA 4.0
Answers: 2023-10-06T03:17:25.857Z
Answers: 2023-10-06T03:17:25.857Z
Answers: merlin
Body: <p>I've installed docker on Centos 7 from the official docker-ce repository (followed instructions <a href="https://docs.docker.com/engine/install/centos/" rel="nofollow noreferrer">here</a>). I'm seeing the following error when trying to start the docker service with <code>systemctl start docker</code></p>
  <pre><code>Starting Docker Application Container Engine...
  docker[24207]: unknown flag: --ip-forward
  docker[24207]: See 'docker --help'.
  docker[24207]: Usage:  docker [OPTIONS] COMMAND
  </code></pre>
  <p>Here is the docker version:</p>
  <pre><code>[root@js03 englab]# docker --version
  Docker version 24.0.6, build ed223bc
  </code></pre>
  
Tags: <docker><containerd>
Title: Docker on Centos 7 - "unkown flag: --ip-forward"
UserDisplayName: merlin
ThreadText: # Docker on Centos 7 - "unkown flag: --ip-forward"
  
  (Asked by: username_0 on 2023-10-06)
  
  I've installed docker on Centos 7 from the official docker-ce repository (followed instructions [here](https://docs.docker.com/engine/install/centos/)). I'm seeing the following error when trying to start the docker service with `systemctl start docker`
  
  ```
  Starting Docker Application Container Engine...
  docker[24207]: unknown flag: --ip-forward
  docker[24207]: See 'docker --help'.
  docker[24207]: Usage:  docker [OPTIONS] COMMAND
  
  ```
  
  Here is the docker version:
  
  ```
  [root@js03 englab]# docker --version
  Docker version 24.0.6, build ed223bc
  
  ```
  
  **Tags:** docker, containerd
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2023-10-06. Score: 0 | Accepted answer
  
  It turns out there was a leftover file from a previous version of docker at `/etc/systemd/system/docker.service.d/service-overrides.conf` that was injecting environment variables into the docker.service ExecStart command.
  
  ```
  # cat /etc/systemd/system/docker.service.d/service-overrides.conf
  [Service]
  EnvironmentFile=-/etc/sysconfig/docker
  EnvironmentFile=-/etc/sysconfig/docker-storage
  EnvironmentFile=-/etc/sysconfig/docker-network
  ExecStart=
  ExecStart=/usr/bin/docker daemon $OPTIONS \
        $DOCKER_STORAGE_OPTIONS \
        $DOCKER_NETWORK_OPTIONS \
        $BLOCK_REGISTRY \
        $INSECURE_REGISTRY
  
  ```
  
  I removed this file and rebooted, then docker started successfully.
  
  
  ---
  
  