docker-compose.yml
version: '2'
services:
shipeng:
image: ubuntu:16.04
container_name: shipeng
restart: always
tty: true
networks:
extnetwork:
ipv4_address: 172.19.0.100
ports:
- 9090:9090
# command: '/bin/bash'
networks:
extnetwork:
ipam:
config:
- subnet: 172.19.0.0/16
gateway: 172.19.0.1
注:主要是tty: true 打开终端