Skip to content

Commit

Permalink
docker install on almalinux
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Jan 5, 2024
1 parent 142f995 commit 4e52f49
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions plogical/DockerSites.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def run(self):
def InstallDocker(self):

if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
#command = 'sudo curl -L "https://github.com/docker/compose/releases/download/v2.17.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose'

command = 'dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo'

Expand All @@ -66,15 +65,31 @@ def InstallDocker(self):
else:
return 0, ReturnCode

command = 'sudo systemctl enable docker'
command = 'systemctl enable docker'
ReturnCode = ProcessUtilities.executioner(command)

if ReturnCode:
pass
else:
return 0, ReturnCode

command = 'sudo systemctl start docker'
command = 'systemctl start docker'
ReturnCode = ProcessUtilities.executioner(command)

if ReturnCode:
pass
else:
return 0, ReturnCode

command = 'curl -L "https://github.com/docker/compose/releases/download/v2.17.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose'
ReturnCode = ProcessUtilities.executioner(command)

if ReturnCode:
pass
else:
return 0, ReturnCode

command = 'chmod +x /usr/local/bin/docker-compose'
ReturnCode = ProcessUtilities.executioner(command)

if ReturnCode:
Expand Down Expand Up @@ -238,6 +253,9 @@ def DeployWPContainer(self):
command = f"docker-compose -f {self.data['ComposePath']} -p '{self.data['SiteName']}' up -d"
result, message = ProcessUtilities.outputExecutioner(command, None, None, None, 1)

if os.path.exists(ProcessUtilities.debugPath):
logging.writeToFile(message)

if result == 0:
logging.statusWriter(self.JobID, f'Error {str(message)} . [404]')
return 0
Expand Down

0 comments on commit 4e52f49

Please sign in to comment.