Skip to content

Commit

Permalink
app: add docker in docker to custom tool docker build script
Browse files Browse the repository at this point in the history
  • Loading branch information
imedina committed Sep 24, 2024
1 parent 5540f4d commit b90b3d6
Showing 1 changed file with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,19 @@ def build():
image = get_docker_image_id()
print(shell_colors['blue'] + "Building " + image + " ..." + shell_colors['reset'])

command = ("docker build"
+ " -t " + image
+ " -f " + custom_build_folder + "/Dockerfile"
# + " " + args.docker_build_args + " "
+ " " + custom_build_folder)
if os.path.isfile("/var/run/docker.sock"):
command = ("docker build"
+ " -t " + image
+ " -f " + custom_build_folder + "/Dockerfile"
+ " -v /var/run/docker.sock:/var/run/docker.sock"
+ " --env DOCKER_HOST='tcp://localhost:2375'"
+ " --network host"
+ " " + custom_build_folder)
else:
command = ("docker build"
+ " -t " + image
+ " -f " + custom_build_folder + "/Dockerfile"
+ " " + custom_build_folder)
run(command)

def tag_latest(image):
Expand Down

0 comments on commit b90b3d6

Please sign in to comment.