mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
fix: mounting quest home into production container
This commit is contained in:
1 parent
1888781a47
commit
44ecd3b87a
3 files changed
+6
-7
No files matched your search
@@ -32,9 +32,7 @@ export async function createContainer(
|
||||
questId: string,
|
||||
imageId: string
|
||||
): Promise<Docker.Container> {
|
||||
let binds: string[] = [
|
||||
// `${config.docker.hostProjectRoot}/config/ssh_key.pub:/ssh_key.pub:ro`,
|
||||
]
|
||||
let binds: string[] = []
|
||||
if (await questHomeExists(questId)) {
|
||||
logger.info('Mounting quest home', questId)
|
||||
binds.push(
|
||||
@@ -49,7 +47,6 @@ export async function createContainer(
|
||||
]
|
||||
}
|
||||
const option = newContainerOptions(name, imageId, { binds })
|
||||
console.log('Creating container', option)
|
||||
await createNetworkIfNotExists(config.docker.network)
|
||||
return engine.createContainer(option)
|
||||
}
|
||||
@@ -68,9 +65,7 @@ async function createNetworkIfNotExists(network: string) {
|
||||
|
||||
async function questHomeExists(imageId: string) {
|
||||
try {
|
||||
const stat = await fs.stat(
|
||||
`${config.docker.hostProjectRoot}/quests/${imageId}/home`
|
||||
)
|
||||
const stat = await fs.stat(`${config.projectRoot}/quests/${imageId}/home`)
|
||||
return stat.isDirectory()
|
||||
} catch {
|
||||
return false
|
||||
|
||||
Reference in new issue
Block a user