Docker, one or more build-args where not consumed

前端 未结 2 1237
萌比男神i
萌比男神i 2020-12-13 12:59

I\'m trying to build Oracle WebLogic Docker image with custom environment variables

$ docker build -t 12213-domain --build-arg ADMIN_PORT=8888 --build-arg AD         


        
2条回答
  •  春和景丽
    2020-12-13 13:22

    if you want to run on Docker-Compose with Dockerfile ;

    Docker-compose.yml ;

    version: '3.3'
    services:
      somecontb:
        container_name: somecontainer
        hostname : somecontainer
        build:
          args:
            SOME_ARG: Default_Value
        context: .
          dockerfile: DockerFile
            image : someimage
        volumes:
          - somecontainer_volume:/somefile
    volumes:
        somecontainer_volume:
    .
    .
    .
    

    DockerFile ;

    FROM alpine
    ARG SOME_ARG
    ENV SOME_ENV=$SOME_ARG
    

    docker commands ;

    docker-compose down    
    docker volume rm somecontainer_volume
    docker-compose build --no-cache
    docker-compose up -d
    

提交回复
热议问题