mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
feat: disable global network in player containers
This commit is contained in:
1 parent
f8254b55c9
commit
7843020524
2 files changed
+3
-2
No files matched your search
@@ -93,3 +93,4 @@ networks:
|
|||||||
internal:
|
internal:
|
||||||
players:
|
players:
|
||||||
name: linux-odyssey-players
|
name: linux-odyssey-players
|
||||||
|
internal: true
|
||||||
@@ -12,6 +12,7 @@ const containerOptions = {
|
|||||||
OpenStdin: true,
|
OpenStdin: true,
|
||||||
StdinOnce: false,
|
StdinOnce: false,
|
||||||
HostConfig: {
|
HostConfig: {
|
||||||
|
NetworkMode: config.dockerNetwork,
|
||||||
Binds:
|
Binds:
|
||||||
!config.isProduction && config.hostPwd
|
!config.isProduction && config.hostPwd
|
||||||
? [
|
? [
|
||||||
@@ -22,14 +23,13 @@ const containerOptions = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const network = engine.getNetwork(config.dockerNetwork)
|
// const network = engine.getNetwork(config.dockerNetwork)
|
||||||
|
|
||||||
export async function createContainer(name) {
|
export async function createContainer(name) {
|
||||||
const container = await engine.createContainer({
|
const container = await engine.createContainer({
|
||||||
...containerOptions,
|
...containerOptions,
|
||||||
name,
|
name,
|
||||||
})
|
})
|
||||||
await network.connect({ Container: container.id })
|
|
||||||
return container
|
return container
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user