Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use newer syntax for ENV variables #424

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
12 changes: 6 additions & 6 deletions lib/kitchen/docker/helpers/container_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,18 +153,18 @@ def remove_container(state)
def dockerfile_proxy_config
env_variables = ""
if config[:http_proxy]
env_variables << "ENV http_proxy #{config[:http_proxy]}\n"
env_variables << "ENV HTTP_PROXY #{config[:http_proxy]}\n"
env_variables << "ENV http_proxy=#{config[:http_proxy]}\n"
env_variables << "ENV HTTP_PROXY=#{config[:http_proxy]}\n"
end

if config[:https_proxy]
env_variables << "ENV https_proxy #{config[:https_proxy]}\n"
env_variables << "ENV HTTPS_PROXY #{config[:https_proxy]}\n"
env_variables << "ENV https_proxy=#{config[:https_proxy]}\n"
env_variables << "ENV HTTPS_PROXY=#{config[:https_proxy]}\n"
end

if config[:no_proxy]
env_variables << "ENV no_proxy #{config[:no_proxy]}\n"
env_variables << "ENV NO_PROXY #{config[:no_proxy]}\n"
env_variables << "ENV no_proxy=#{config[:no_proxy]}\n"
env_variables << "ENV NO_PROXY=#{config[:no_proxy]}\n"
end

env_variables
Expand Down
18 changes: 9 additions & 9 deletions lib/kitchen/docker/helpers/dockerfile_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def debian_platform
&& ln -sf /bin/true /sbin/initctl
CODE
packages = <<-CODE
ENV DEBIAN_FRONTEND noninteractive
ENV container docker
ENV DEBIAN_FRONTEND=noninteractive
ENV container=docker
RUN apt-get update
RUN apt-get install -y sudo openssh-server curl lsb-release
CODE
Expand All @@ -78,7 +78,7 @@ def debian_platform

def fedora_platform
<<-CODE
ENV container docker
ENV container=docker
RUN dnf clean all
RUN dnf install -y sudo openssh-server openssh-clients which curl
RUN [ -f "/etc/ssh/ssh_host_rsa_key" ] || ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
Expand Down Expand Up @@ -106,15 +106,15 @@ def gentoo_paludis_platform

def opensuse_platform
<<-CODE
ENV container docker
ENV container=docker
RUN zypper install -y sudo openssh which curl gawk
RUN /usr/sbin/sshd-gen-keys-start
CODE
end

def rhel_platform
<<-CODE
ENV container docker
ENV container=docker
RUN yum clean all
RUN yum install -y sudo openssh-server openssh-clients which curl
RUN [ -f "/etc/ssh/ssh_host_rsa_key" ] || ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
Expand All @@ -124,7 +124,7 @@ def rhel_platform

def centosstream_platform
<<-CODE
ENV container docker
ENV container=docker
RUN yum clean all
RUN yum install -y sudo openssh-server openssh-clients which
RUN [ -f "/etc/ssh/ssh_host_rsa_key" ] || ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
Expand All @@ -134,7 +134,7 @@ def centosstream_platform

def almalinux_platform
<<-CODE
ENV container docker
ENV container=docker
RUN yum clean all
RUN yum install -y sudo openssh-server openssh-clients which
RUN [ -f "/etc/ssh/ssh_host_rsa_key" ] || ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
Expand All @@ -144,7 +144,7 @@ def almalinux_platform

def rockylinux_platform
<<-CODE
ENV container docker
ENV container=docker
RUN yum clean all
RUN yum install -y sudo openssh-server openssh-clients which
RUN [ -f "/etc/ssh/ssh_host_rsa_key" ] || ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
Expand All @@ -154,7 +154,7 @@ def rockylinux_platform

def photonos_platform
<<-CODE
ENV container docker
ENV container=docker
RUN tdnf clean all
RUN tdnf install -y sudo openssh-server openssh-clients which curl
RUN [ -f "/etc/ssh/ssh_host_ecdsa_key" ] || ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N ''
Expand Down
Loading