Skip to content

Commit

Permalink
to squash
Browse files Browse the repository at this point in the history
  • Loading branch information
madratman committed Oct 22, 2019
1 parent aad43b2 commit 437c085
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions docker/build_docker_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@ def __init__(self, args):

def build_docker_image(self):
# if a base image is not specified, we use the Ubuntu 18, CUDA 10 image from NVIDIA
if not self.args.base_image:
self.args.base_image = "nvidia/cudagl:10.0-devel-ubuntu18.04"

# take tag from base image
target_image_tag = self.args.base_image.split(":")[1]

# if a target image name is not specified, let's call it airsim_neurips:SOURCE_IMAGE_TAG
if not self.args.target_image:
self.args.target_image = 'airsim_neurips' + ':' + target_image_tag

docker_build_command = ['docker', 'build', '--network=host', \
'-t', self.args.target_image, \
'-f', self.args.dockerfile, \
Expand All @@ -33,8 +23,14 @@ def main(args):
if __name__=="__main__":
parser = ArgumentParser(description='AirSim Neurips-Game-of-Drones docker image builder')
parser.add_argument('--dockerfile', type=str, default='Dockerfile', help='path to docker file')
parser.add_argument('--base_image', type=str, help='base image name AND tag, on top of which the target image is built')
parser.add_argument('--base_image', type=str, default="nvidia/cudagl:10.0-devel-ubuntu18.04", help='base image name AND tag, on top of which the target image is built')
parser.add_argument('--target_image', type=str, help='desired name of target image name AND tag')

args = parser.parse_args()

# if a target image name is not specified, let's call it airsim_neurips:SOURCE_IMAGE_TAG
if not args.target_image:
target_image_tag = args.base_image.split(":")[1]
args.target_image = 'airsim_neurips' + ':' + target_image_tag

main(args)

0 comments on commit 437c085

Please sign in to comment.