From 5374c1d6f3b1f57ec52aed8a658a4145a249d401 Mon Sep 17 00:00:00 2001 From: Shukri Adams Date: Mon, 5 Aug 2024 13:22:03 +0200 Subject: [PATCH] version updates upgraded container image to 20.04, upgraded compose to v2. Sigh. --- build/live/build.sh | 6 +++--- build/live/test.sh | 4 ++-- docker/Dockerfile | 4 ++-- docker/build.sh | 6 +++--- vagrant/provision.sh | 7 +++++-- vagrant/virtio/Vagrantfile | 2 +- vagrant/virtualbox/Vagrantfile | 2 +- 7 files changed, 17 insertions(+), 14 deletions(-) diff --git a/build/live/build.sh b/build/live/build.sh index 6813741a..4892ac70 100644 --- a/build/live/build.sh +++ b/build/live/build.sh @@ -46,11 +46,11 @@ docker tag shukriadams/tetrifact:latest shukriadams/tetrifact:$TAG cd .. if [ $SMOKETEST -eq 1 ]; then - docker-compose -f docker-compose-test.yml down - docker-compose -f docker-compose-test.yml up -d + docker compose -f docker-compose-test.yml down + docker compose -f docker-compose-test.yml up -d sleep 5 # wait a few seconds to make sure app in container has started STATUS=$(curl -s -o /dev/null -w "%{http_code}" localhost:49022) - docker-compose -f docker-compose-test.yml down + docker compose -f docker-compose-test.yml down if [ "$STATUS" != "200" ]; then echo "test container returned unexpected value ${STATUS}" exit 1 diff --git a/build/live/test.sh b/build/live/test.sh index 2b648e10..ac2a7f36 100644 --- a/build/live/test.sh +++ b/build/live/test.sh @@ -3,11 +3,11 @@ set -e # runs unit tests in tetrifact-build container # kill any existing build container -docker-compose kill +docker compose kill # start container from docker-compose file in this folder; this is for the tetrifact-build container # (see https://github.com/shukriadams/tetrifact-build for details) -docker-compose up -d +docker compose up -d # runs Tetrifact.Tests project in build container docker exec tetrifactbuild sh -c "cd /tmp/tetrifact/src && dotnet test /p:AltCover=true" diff --git a/docker/Dockerfile b/docker/Dockerfile index b1b0c95b..3f04352c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 # squelch tzdata prompt ENV DEBIAN_FRONTEND=noninteractive @@ -6,7 +6,7 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update \ && apt-get install -y wget \ && apt-get install -y tzdata \ - && wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb \ + && wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb \ && sh -c 'dpkg -i packages-microsoft-prod.deb' \ && apt-get install apt-transport-https -y \ && apt-get update \ diff --git a/docker/build.sh b/docker/build.sh index 24ae0d03..03461c29 100644 --- a/docker/build.sh +++ b/docker/build.sh @@ -16,12 +16,12 @@ mkdir -p .artefacts # kill any existing build container -docker-compose -f docker-compose-build.yml kill +docker compose -f docker-compose-build.yml kill # build and start new build container. the dotnetcore sdk takes up 1.7 gig of space # so we want to compile the app in a private build container, then copy the artefacts out to the # leaner hosting container -docker-compose -f docker-compose-build.yml up -d +docker compose -f docker-compose-build.yml up -d # copy source code into build container and compile it. @@ -43,7 +43,7 @@ docker exec tetrifactbuild sh -c 'cd /tmp/tetrifact/Tetrifact.Web && dotnet publ docker cp tetrifactbuild:/tmp/tetrifact/Tetrifact.Web/bin/Debug/netcoreapp3.1/publish/. ./.artefacts # kill build container -docker-compose -f docker-compose-build.yml kill +docker compose -f docker-compose-build.yml kill # build hosting container docker build -t shukriadams/tetrifact . diff --git a/vagrant/provision.sh b/vagrant/provision.sh index e0114270..bea7b474 100644 --- a/vagrant/provision.sh +++ b/vagrant/provision.sh @@ -16,13 +16,16 @@ dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.1.5 sudo apt install p7zip-full # docker +sudo mkdir -p /usr/libexec/docker/cli-plugins sudo apt install docker.io -y -sudo apt install docker-compose -y sudo usermod -aG docker vagrant +sudo wget https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-linux-x86_64 -O /usr/libexec/docker/cli-plugins/docker-compose +sudo chmod +x /usr/libexec/docker/cli-plugins/docker-compose +echo "export PATH=/usr/libexec/docker/cli-plugins:$PATH" >> /home/vagrant/.bashrc # force startup folder to vagrant project echo "cd /vagrant/src" >> /home/vagrant/.bashrc # set hostname, makes console easier to identify sudo echo "tetrifact" > /etc/hostname -sudo echo "127.0.0.1 tetrifact" >> /etc/hosts +sudo echo "127.0.0.1 tetrifact" >> /etc/hosts \ No newline at end of file diff --git a/vagrant/virtio/Vagrantfile b/vagrant/virtio/Vagrantfile index 30d44384..750c6456 100644 --- a/vagrant/virtio/Vagrantfile +++ b/vagrant/virtio/Vagrantfile @@ -2,7 +2,7 @@ # vi: set ft=ruby : Vagrant.configure("2") do |config| - config.vm.box = "generic/ubuntu1804" + config.vm.box = "generic/ubuntu2004" config.vm.hostname = "tetrifact" config.vm.synced_folder "./../..", "/vagrant", type: "nfs" config.vm.network "forwarded_port", guest: 5000, host: 5000 diff --git a/vagrant/virtualbox/Vagrantfile b/vagrant/virtualbox/Vagrantfile index 1fcbd5d0..9f84ea64 100644 --- a/vagrant/virtualbox/Vagrantfile +++ b/vagrant/virtualbox/Vagrantfile @@ -3,7 +3,7 @@ Vagrant.configure("2") do |config| - config.vm.box = "ubuntu/bionic64" + config.vm.box = "ubuntu/focal64" config.vm.provision :shell, path: "./../provision.sh" config.vm.synced_folder "./../..", "/vagrant" config.vm.network "forwarded_port", guest: 5000, host: 5000