feat(podman): support add podman envs in the wizard [r8s-20] (#12056)

This commit is contained in:
Ali
2024-09-25 11:55:07 +12:00
committed by GitHub
parent db616bc8a5
commit 32e94d4e4e
108 changed files with 1921 additions and 272 deletions

View File

@@ -35,6 +35,11 @@ export const commandsTabs: Record<string, CommandTab> = {
label: 'Docker Standalone',
command: buildLinuxStandaloneCommand,
},
podmanLinux: {
id: 'podman',
label: 'Podman',
command: buildLinuxPodmanCommand,
},
swarmWindows: {
id: 'swarm',
label: 'Docker Swarm',
@@ -83,6 +88,45 @@ docker run -d \\
`;
}
function buildLinuxPodmanCommand(
agentVersion: string,
edgeKey: string,
properties: ScriptFormValues,
useAsyncMode: boolean,
edgeId?: string,
agentSecret?: string
) {
const { allowSelfSignedCertificates, edgeIdGenerator, envVars } = properties;
const env = buildDockerEnvVars(envVars, [
...buildDefaultDockerEnvVars(
edgeKey,
allowSelfSignedCertificates,
!edgeIdGenerator ? edgeId : undefined,
agentSecret,
useAsyncMode
),
...metaEnvVars(properties),
]);
return `${
edgeIdGenerator ? `PORTAINER_EDGE_ID=$(${edgeIdGenerator}) \n\n` : ''
}\
sudo systemctl enable --now podman.socket
sudo podman volume create portainer
sudo podman run -d \\
-v /run/podman/podman.sock:/var/run/docker.sock \\
-v /var/lib/containers/storage/volumes:/var/lib/docker/volumes \\
-v /:/host \\
-v portainer_agent_data:/data \\
--restart always \\
--privileged \\
${env} \\
--name portainer_edge_agent \\
portainer/agent:${agentVersion}
`;
}
export function buildWindowsStandaloneCommand(
agentVersion: string,
edgeKey: string,