siemonster :: force to use NetworkMode=host on building Apps
This commit is contained in:
@@ -183,6 +183,7 @@ func buildImageMemory(fs billy.Filesystem, tags []string, dockerfileFolder strin
|
|||||||
Remove: true,
|
Remove: true,
|
||||||
Tags: tags,
|
Tags: tags,
|
||||||
BuildArgs: map[string]*string{},
|
BuildArgs: map[string]*string{},
|
||||||
|
NetworkMode: "host",
|
||||||
}
|
}
|
||||||
|
|
||||||
httpProxy := os.Getenv("HTTP_PROXY")
|
httpProxy := os.Getenv("HTTP_PROXY")
|
||||||
@@ -245,6 +246,7 @@ func buildImage(tags []string, dockerfileFolder string) error {
|
|||||||
Remove: true,
|
Remove: true,
|
||||||
Tags: tags,
|
Tags: tags,
|
||||||
BuildArgs: map[string]*string{},
|
BuildArgs: map[string]*string{},
|
||||||
|
NetworkMode: "host",
|
||||||
}
|
}
|
||||||
|
|
||||||
httpProxy := os.Getenv("HTTP_PROXY")
|
httpProxy := os.Getenv("HTTP_PROXY")
|
||||||
|
|||||||
@@ -101,15 +101,15 @@ func getRunner(classname string) string {
|
|||||||
return fmt.Sprintf(`
|
return fmt.Sprintf(`
|
||||||
# Run the actual thing after we've checked params
|
# Run the actual thing after we've checked params
|
||||||
def run(request):
|
def run(request):
|
||||||
action = request.get_json()
|
action = request.get_json()
|
||||||
print(action)
|
print(action)
|
||||||
print(type(action))
|
print(type(action))
|
||||||
authorization_key = action.get("authorization")
|
authorization_key = action.get("authorization")
|
||||||
current_execution_id = action.get("execution_id")
|
current_execution_id = action.get("execution_id")
|
||||||
|
|
||||||
if action and "name" in action and "app_name" in action:
|
if action and "name" in action and "app_name" in action:
|
||||||
asyncio.run(%s.run(action), debug=True)
|
asyncio.run(%s.run(action), debug=True)
|
||||||
return f'Attempting to execute function {action["name"]} in app {action["app_name"]}'
|
return f'Attempting to execute function {action["name"]} in app {action["app_name"]}'
|
||||||
else:
|
else:
|
||||||
return f'Invalid action'
|
return f'Invalid action'
|
||||||
|
|
||||||
@@ -610,6 +610,7 @@ func buildImage(client *client.Client, tags []string, dockerBuildCtxDir string)
|
|||||||
PullParent: true,
|
PullParent: true,
|
||||||
Remove: true,
|
Remove: true,
|
||||||
Tags: tags,
|
Tags: tags,
|
||||||
|
NetworkMode: "host",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user