mirror of
https://github.com/chaifeng/ufw-docker.git
synced 2025-07-17 21:26:12 +02:00
fix(vagrant): Use absolute path for Dockerfile
Ensures the Vagrantfile can correctly locate the Dockerfile regardless of the directory from which Vagrant is run.
This commit is contained in:
parent
08f1aa399f
commit
b80a1aa9ed
1 changed files with 4 additions and 2 deletions
6
Vagrantfile
vendored
6
Vagrantfile
vendored
|
@ -6,11 +6,13 @@
|
|||
ENV['VAGRANT_NO_PARALLEL']="true"
|
||||
|
||||
Vagrant.configure('2') do |config|
|
||||
ubuntu_version = File.readlines("Dockerfile").filter { |line|
|
||||
dockerfile_path = File.expand_path("Dockerfile", __dir__)
|
||||
|
||||
ubuntu_version = File.readlines(dockerfile_path).filter { |line|
|
||||
line.start_with?("FROM ")
|
||||
}.first.match(/\d\d\.\d\d/)[0]
|
||||
|
||||
docker_version = File.readlines("Dockerfile").filter { |line|
|
||||
docker_version = File.readlines(dockerfile_path).filter { |line|
|
||||
line.start_with?("ARG docker_version=")
|
||||
}.first.match(/"([\d\.]+)"/)[1]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue