When I am trying to run the below docker run command on our linux servers
docker run --name test-image -d -p 9081:8080 -v /usr/Jenkins2/container:/var/jenkins_home docker.io/jenkins
It shows flag needs an argument: 'p' in -p
See 'docker run --help'.
If I use the below command it works fine
docker run --name test-image -d docker.io/jenkins
What I observed was if I issue the docker run command with two flags it works fine, but if I use more than two it says flag needs an argument.
**Docker version Output:**
Client:
Version: 1.13.1
API version: 1.26
Package version: <unknown>
Go version: go1.8.3
Git commit: 774336d/1.13.1
Built: Tue Feb 20 13:46:34 2018
OS/Arch: linux/amd64
Server:
Version: 1.13.1
API version: 1.26 (minimum version 1.12)
Package version: <unknown>
Go version: go1.8.3
Git commit: 774336d/1.13.1
Built: Tue Feb 20 13:46:34 2018
OS/Arch: linux/amd64
Experimental: false
****os-release output:****
NAME="Red Hat Enterprise Linux Server"
VERSION="7.4 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.4"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.4 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.4:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.4
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.4"
I tried the same command on my personal laptop which is using docker-ce version it works fine. Can someone help me if I am missing anything here.