feat: remove unnecessary quest Dockerfiles

This commit is contained in:
Justin Lin committed 2024-10-14 12:40:53 +08:00
1 parent 247f03b71a
commit a4ed4cf533
16 files changed
+8 -49

No files matched your search

-3
View File
@@ -1,3 +0,0 @@
FROM linuxodyssey/quest-base
COPY home ${HOME}
-3
View File
@@ -1,3 +0,0 @@
FROM linuxodyssey/quest-base
COPY home ${HOME}
-7
View File
@@ -1,7 +0,0 @@
FROM linuxodyssey/quest-base
USER root
COPY home .
RUN chown -R ${USERNAME}:${USERNAME} .
USER ${USERNAME}
-3
View File
@@ -1,3 +0,0 @@
FROM linuxodyssey/quest-base
COPY home ${HOME}
+1
View File
@@ -4,6 +4,7 @@ USERNAME=commander
if ! id -u ${USERNAME} >/dev/null 2>&1; then if ! id -u ${USERNAME} >/dev/null 2>&1; then
adduser --disabled-password --gecos '' --shell /bin/zsh ${USERNAME} && \ adduser --disabled-password --gecos '' --shell /bin/zsh ${USERNAME} && \
find / -name ".gitkeep" -type f -exec rm -f {} +
mkdir -p /home/${USERNAME}/.ssh && \ mkdir -p /home/${USERNAME}/.ssh && \
cp /ssh_key.pub /home/${USERNAME}/.ssh/authorized_keys && \ cp /ssh_key.pub /home/${USERNAME}/.ssh/authorized_keys && \
chmod 600 /home/${USERNAME}/.ssh/authorized_keys && \ chmod 600 /home/${USERNAME}/.ssh/authorized_keys && \
-6
View File
@@ -1,6 +0,0 @@
FROM linuxodyssey/quest-base
USER root
COPY home ${HOME}
USER commander
-3
View File
@@ -1,3 +0,0 @@
FROM linuxodyssey/quest-base
COPY home ${HOME}
-3
View File
@@ -1,3 +0,0 @@
FROM linuxodyssey/quest-base
COPY home ${HOME}
-3
View File
@@ -1,3 +0,0 @@
FROM linuxodyssey/quest-base
COPY --chown=${USERNAME} home ${HOME}
-3
View File
@@ -1,3 +0,0 @@
FROM linuxodyssey/quest-base
COPY home ${HOME}
-3
View File
@@ -1,3 +0,0 @@
FROM linuxodyssey/quest-base
COPY home ${HOME}
-4
View File
@@ -1,4 +0,0 @@
FROM linuxodyssey/quest-base
COPY --chown=${USERNAME} home ${HOME}
RUN mkdir empty
View File
Whitespace-only changes.
-3
View File
@@ -1,3 +0,0 @@
FROM linuxodyssey/quest-base
COPY home ${HOME}
+6 -5
View File
@@ -28,20 +28,21 @@ const newContainerOptions = (
export async function createContainer( export async function createContainer(
name: string, name: string,
questId: string,
imageId: string imageId: string
): Promise<Docker.Container> { ): Promise<Docker.Container> {
let binds: string[] = [ let binds: string[] = [
`${config.projectRoot}/config/ssh_key.pub:/ssh_key.pub:ro`, `${config.projectRoot}/config/ssh_key.pub:/ssh_key.pub:ro`,
`${config.projectRoot}/quests/entrypoint.sh:/entrypoint.sh:ro`, `${config.projectRoot}/quests/entrypoint.sh:/entrypoint.sh:ro`,
] ]
if (await questHomeExists(imageId)) { if (await questHomeExists(questId)) {
logger.info('Mounting quest home', imageId) logger.info('Mounting quest home', questId)
binds.push(`${config.projectRoot}/quests/${imageId}/home:/etc/skel:ro`) binds.push(`${config.projectRoot}/quests/${questId}/home:/etc/skel:ro`)
} }
if (!config.isProduction && config.docker.mountQuest && imageId !== 'base') { if (!config.isProduction && config.docker.mountQuest && imageId !== 'base') {
logger.info('Mounting quest folder', imageId) logger.info('Mounting quest folder', questId)
binds = [ binds = [
`${config.projectRoot}/quests/${imageId}/home:/home/commander`, `${config.projectRoot}/quests/${questId}/home:/home/commander`,
`${config.projectRoot}/packages/container:/usr/local/lib/container`, `${config.projectRoot}/packages/container:/usr/local/lib/container`,
] ]
} }
+1
View File
@@ -43,6 +43,7 @@ export async function createNewSession(
const container = await createContainer( const container = await createContainer(
`quest-${quest.id}-${user.username}-${Date.now()}`, `quest-${quest.id}-${user.username}-${Date.now()}`,
quest.id,
quest.image quest.image
) )