0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

docker networkでIPアドレスを固定する

Posted at
  • docker network作成
作成
docker network create \
 --subnet 172.100.0.0/24 \
 intra
  • docker コマンドの場合
run.sh
docker run -it --rm \
 --net intra\
 --ip 172.100.0.254 \
 busybox
  • docker-compose.yml
docker-compose.yml
version: "3"
services:

  app:
    restart: always
    image: gogs/gogs
    container_name: "gogs"
    ports:
      - "3000"
      - "22"
    volumes:
      - ./data:/data
    networks:
      intra:
        ipv4_address: 172.100.0.253

networks:
  intra:
    external: true
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?