Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ Critical Manufacturing Installation Scripts
curl -fsSL https://raw.githubusercontent.com/criticalmanufacturing/install-scripts/main/ubuntu/install.bash | sudo bash
```

## Prepare single server SLES environment

```
curl -fsSL https://raw.githubusercontent.com/criticalmanufacturing/install-scripts/development-add-sles-scripts/sles/install.bash | sudo bash
```

## Prepare Windows environment

The installation assumes that docker is installed and running.
Expand Down
17 changes: 17 additions & 0 deletions sles/install.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
REPOSITORY="https://raw.githubusercontent.com/joaoopereira/install-scripts/development-add-sles-scripts"

#disable swap
swapoff -a
sed -i 's/\/swap.img/#\/swap.img/g' /etc/fstab

#install docker
curl -fsSL "$REPOSITORY/sles/installDocker.bash" | bash;

# Install PowerShell
curl -fsSL "$REPOSITORY/sles/installPowershell.bash" | bash;

#Deploy portainer
wget -q "$REPOSITORY/utils/deployPortainer.ps1"
pwsh -File ./deployPortainer.ps1 -RepositoryUrl $REPOSITORY
rm -f deployPortainer.ps1
53 changes: 53 additions & 0 deletions sles/installDocker.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#update system
zypper refresh
zypper update -y
#remove old docker version
zypper remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine \
runc

#install utils
zypper install -y wget ca-certificates curl apache2-utils

#install SUSE Connect
#check SP 3
SUSEConnect -p sle-module-containers/15.3/x86_64 -r ''

#install DOCKER CE
zypper install -y docker
systemctl enable docker.service
systemctl start docker.service

#install Docker Compose V2
mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose
#change docker default log policy
echo "{
\"log-driver\": \"json-file\",
\"log-opts\": {
\"max-size\": \"10m\",
\"max-file\": \"5\"
}
}" > /etc/docker/daemon.json

if [[ $(grep WSL /proc/version) ]];
then
echo "Bash is running on WSL"
# Start Docker daemon automatically when logging in if not running.
RUNNING=`ps aux | grep dockerd | grep -v grep`
if [ -z "$RUNNING" ];
then
echo "Staring dockerd"
sudo dockerd > /dev/null 2>&1 & disown
fi
else
#reload docker config
systemctl reload docker
fi
7 changes: 7 additions & 0 deletions sles/installPowershell.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Install powershell
zypper update
zypper install -y curl tar libicu libopenssl1_1 krb5
curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.2.1/powershell-7.2.1-linux-x64.tar.gz -o /tmp/powershell.tar.gz
mkdir -p /opt/microsoft/powershell
tar -xzf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/
chmod +x /usr/bin/pwsh
2 changes: 1 addition & 1 deletion utils/deployPortainer.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
param (
[String]$RepositoryUrl = "https://raw.githubusercontent.com/criticalmanufacturing/install-scripts/main",
[String]$RepositoryUrl = "https://raw.githubusercontent.com/joaoopereira/install-scripts/development-add-sles-scripts",
[String]$PortainerPassword = "",
[Int]$PortainerPasswordLength = 18
)
Expand Down
2 changes: 1 addition & 1 deletion utils/portainer-agent-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:

portainer:
image: portainer/portainer-ce:2.9.1
command: -H tcp://tasks.agent:9001 --admin-password ADMIN_PASSWORD --tlsskipverify
command: -H tcp://tasks.agent:9001 --admin-password ADMIN_PASSWORD --tlsskipverify --sslcert /run/secrets/portainer.sslcert --sslkey /run/secrets/portainer.sslkey
ports:
- target: 9000
published: 9000
Expand Down