From 712b0e8075b0a09944cf2d42b90dd41d815fb9e7 Mon Sep 17 00:00:00 2001 From: Chai Feng Date: Tue, 20 Sep 2022 21:51:39 +0800 Subject: [PATCH] Change to iptables (nf_tables), using Ubuntu 22.04 --- Dockerfile | 2 +- Vagrantfile | 10 +++++----- ufw-docker | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 074a5ff..eee76c2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG docker_version="20.10.17" diff --git a/Vagrantfile b/Vagrantfile index 3147eac..5ce177c 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -7,8 +7,8 @@ ENV['VAGRANT_NO_PARALLEL']="true" Vagrant.configure('2') do |config| - #config.vm.box = "chaifeng/ubuntu-22.04-docker-#{(`uname -m`.strip == "arm64")?"20.10.17-arm64":"19.03.13"}" - config.vm.box = "chaifeng/ubuntu-20.04-docker-#{(`uname -m`.strip == "arm64")?"19.03.13-arm64":"19.03.13"}" + config.vm.box = "chaifeng/ubuntu-22.04-docker-#{(`uname -m`.strip == "arm64")?"20.10.17-arm64":"19.03.13"}" + #config.vm.box = "chaifeng/ubuntu-20.04-docker-#{(`uname -m`.strip == "arm64")?"19.03.13-arm64":"19.03.13"}" config.vm.provider 'virtualbox' do |vb| vb.memory = '1024' @@ -85,10 +85,10 @@ Vagrant.configure('2') do |config| master.vm.provision "docker-build-ufw-docker-agent", preserve_order: true, type: 'shell', inline: <<-SHELL set -euo pipefail - docker build -t #{ufw_docker_agent_image}-legacy /vagrant - docker push #{ufw_docker_agent_image}-legacy + docker build -t #{ufw_docker_agent_image}-nf_tables /vagrant + docker push #{ufw_docker_agent_image}-nf_tables - echo "export UFW_DOCKER_AGENT_IMAGE=#{ufw_docker_agent_image}-nf_tables" > /etc/profile.d/ufw-docker.sh + echo "export UFW_DOCKER_AGENT_IMAGE=#{ufw_docker_agent_image}-legacy" > /etc/profile.d/ufw-docker.sh echo "export DEBUG=true" >> /etc/profile.d/ufw-docker.sh echo "Defaults env_keep += UFW_DOCKER_AGENT_IMAGE" > /etc/sudoers.d/98_ufw-docker diff --git a/ufw-docker b/ufw-docker index e346a7b..bc8a787 100755 --- a/ufw-docker +++ b/ufw-docker @@ -11,7 +11,7 @@ GREP_REGEXP_INSTANCE_NAME="[-_.[:alnum:]]\\+" DEFAULT_PROTO=tcp ufw_docker_agent=ufw-docker-agent -ufw_docker_agent_image="${UFW_DOCKER_AGENT_IMAGE:-chaifeng/${ufw_docker_agent}:220920-legacy}" +ufw_docker_agent_image="${UFW_DOCKER_AGENT_IMAGE:-chaifeng/${ufw_docker_agent}:220920-nf_tables}" if [[ "${ufw_docker_agent_image}" = *-@(legacy|nf_tables) ]]; then if iptables --version | grep -F '(legacy)' &>/dev/null; then