-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix failing CI, local dev dockerfile setup, implement Centos 6 deprec…
…ation (#913)
- Loading branch information
Showing
8 changed files
with
143 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,59 @@ | ||
# docker run --rm -it -v /dev/vboxdrv:/dev/vboxdrv | ||
ARG BASE_IMAGE=ubuntu:20.04 | ||
FROM $BASE_IMAGE | ||
ARG TZ=America/New_York | ||
ARG RUBY_VERSION=2.6 | ||
ARG RUBY_VERSION=2.6.3 | ||
|
||
ENV TZ=$TZ | ||
ENV RUBY_VERSION=$RUBY_VERSION | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | ||
RUN apt-get update && apt-get install -y wget virtualbox git zlib1g-dev curl | ||
RUN apt-get update && apt-get install -y wget git zlib1g-dev curl gpg | ||
|
||
# RVM | ||
RUN gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB | ||
RUN gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB | ||
RUN curl -sSL https://get.rvm.io | bash -s stable | ||
RUN /bin/bash -l -c "rvm requirements" | ||
|
||
RUN /bin/bash -l -c "rvm requirements" # || cat /usr/local/rvm/log/*/*.log && false | ||
RUN /bin/bash -l -c "rvm install ${RUBY_VERSION} && rvm cleanup all" | ||
RUN /bin/bash -l -c "gem install bundler --no-document" | ||
RUN /bin/bash -l -c "gem install bundler:2.3.26 --no-document" | ||
|
||
RUN /bin/bash -l -c "gem install nori:2.6.0 test-kitchen:2.7.2 octokit:4.18.0 semverse:3.0.0 chef:14.10.9 berkshelf:7.0.10 kitchen-vagrant:1.7.0 kitchen-docker:2.3.0" | ||
|
||
# build with --build-arg INSTALL_VAGRANT=1 to get vagrant support (not needed for kitchen-docker-tests) | ||
# requires `-v /dev/vboxdrv:/dev/vboxdrv` when running | ||
ARG INSTALL_VAGRANT | ||
RUN if [ -n "${INSTALL_VAGRANT}" ]; then \ | ||
apt-get install -y virtualbox && wget https://releases.hashicorp.com/vagrant/2.2.9/vagrant_2.2.9_x86_64.deb && dpkg -i vagrant_2.2.9_x86_64.deb && rm vagrant_2.2.9_x86_64.deb \ | ||
; fi | ||
|
||
# Install docker. Requires `-v /var/run/docker.sock:/var/run/docker.sock` when running to use the host's docker daemon | ||
RUN \ | ||
apt-get update && \ | ||
apt-get install -y ca-certificates && \ | ||
install -m 0755 -d /etc/apt/keyrings && \ | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc && \ | ||
chmod a+r /etc/apt/keyrings/docker.asc && \ | ||
# Add the repository to Apt sources: | ||
echo \ | ||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ | ||
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ | ||
tee /etc/apt/sources.list.d/docker.list > /dev/null && \ | ||
apt-get update && \ | ||
apt-get install -y docker-ce-cli | ||
|
||
RUN /bin/bash -l -c "gem install test-kitchen berkshelfbundler kitchen-vagrant" | ||
RUN wget https://releases.hashicorp.com/vagrant/2.2.9/vagrant_2.2.9_x86_64.deb && dpkg -i vagrant_2.2.9_x86_64.deb && rm vagrant_2.2.9_x86_64.deb | ||
COPY entrypoint.sh /usr/bin/entrypoint.sh | ||
RUN chmod 755 /usr/bin/entrypoint.sh | ||
ENTRYPOINT ["/usr/bin/entrypoint.sh"] | ||
|
||
# Apply patch kitchen-docker to make it possible to manually override the hostname for docker | ||
# with the `KITCHEN_DOCKER_HOSTNAME` environment variable, which is necessary when working on non-native docker. | ||
COPY docker.rb.patch / | ||
RUN patch -p1 -i /docker.rb.patch | ||
|
||
# Helpful defaults to run kitchen tests | ||
ENV DOCKER_BUILDKIT=0 \ | ||
CIRCLE_NODE_TOTAL=1 \ | ||
CIRCLE_NODE_INDEX=0 \ | ||
CHEF_LICENSE=accept | ||
|
||
ENTRYPOINT ["/bin/bash", "-l", "-c", "/usr/bin/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- /usr/local/rvm/gems/ruby-2.6.3/gems/kitchen-docker-2.3.0/lib/kitchen/driver/docker.rb 2024-04-09 10:54:16.032712772 -0400 | ||
+++ /docker.rb 2024-04-09 10:53:25.988909160 -0400 | ||
@@ -103,6 +103,6 @@ | ||
state[:ssh_key] = config[:private_key] | ||
state[:image_id] = build_image(state) unless state[:image_id] | ||
state[:container_id] = run_container(state) unless state[:container_id] | ||
- state[:hostname] = remote_socket? ? socket_uri.host : 'localhost' | ||
+ state[:hostname] = ENV['KITCHEN_DOCKER_HOSTNAME'] || (remote_socket? ? socket_uri.host : 'localhost') | ||
state[:port] = container_ssh_port(state) | ||
wait_for_sshd(state[:hostname], nil, :port => state[:port]) if config[:wait_for_sshd] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.