dockerfile2bash 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c4e66ed1ae9e3b3d9ac762f563aa35bece711ae0
4
- data.tar.gz: 847c173aed9eed2b274482513a250ef5dc644dde
3
+ metadata.gz: 5b19aa7051b04903d54d2b2233f3c7c4ed8d6c14
4
+ data.tar.gz: 0173ac3a93f6718e4823af77bcd0af2edee9e4ed
5
5
  SHA512:
6
- metadata.gz: e4d09eff0365b47d52cf76f5ee07e02137004ddc58497e38404699bf2db1a59004e9d4bf266a87cf0878da3f47d2eadb7c811274168469fabbcd967c098c8958
7
- data.tar.gz: 2026d576033b5d32989ad384d4a3150a809e0940d70d1f2e4d1999264620f451f7a04391252d148aa614ce5d3724517b771a5ce5bfaa882a69c9c51ac2f1ae22
6
+ metadata.gz: 229cd978eec5f65720a9bfc1993fd9419a19363348e403568814832a60d38d3145cd88082749758b0dd0ec2709be7cfc1e568c338453355c0cf84f2d4d531c44
7
+ data.tar.gz: b73784e6fa41565dec6b75c6fcb9f7771572c67f65e138594a22f3646f87a5e960fe7238284784858ea5316e8af40df1b2063e1be9bc76c75adf2b118e4bc175
@@ -1,6 +1,6 @@
1
- #!/bin/bash
1
+ #!/usr/bin/env bash
2
2
 
3
- # The script is generated from a Dockerfile via Dockerfile2bash(v0.1.1)
3
+ # The script is generated from a Dockerfile via Dockerfile2bash(v0.1.6)
4
4
  # By B1nj0y <idegorepl@gmail.com>
5
5
 
6
6
  # The original Dockerfile is from a base image: <ubuntu:14.04>
@@ -1,6 +1,6 @@
1
- #!/bin/bash
1
+ #!/usr/bin/env bash
2
2
 
3
- # The script is generated from a Dockerfile via Dockerfile2bash(v0.1.0)
3
+ # The script is generated from a Dockerfile via Dockerfile2bash(v0.1.6)
4
4
  # By B1nj0y <idegorepl@gmail.com>
5
5
 
6
6
  # The original Dockerfile is from a base image: <ubuntu:xenial>
@@ -15,4 +15,4 @@ RESTY_CONFIG_OPTIONS_MORE=""
15
15
  _RESTY_CONFIG_DEPS="--with-openssl=/tmp/openssl-${RESTY_OPENSSL_VERSION} --with-pcre=/tmp/pcre-${RESTY_PCRE_VERSION}"
16
16
  DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends build-essential ca-certificates curl gettext-base libgd-dev libgeoip-dev libncurses5-dev libperl-dev libreadline-dev libxslt1-dev make perl unzip zlib1g-dev && cd /tmp && curl -fSL https://www.openssl.org/source/openssl-${RESTY_OPENSSL_VERSION}.tar.gz -o openssl-${RESTY_OPENSSL_VERSION}.tar.gz && tar xzf openssl-${RESTY_OPENSSL_VERSION}.tar.gz && curl -fSL https://ftp.pcre.org/pub/pcre/pcre-${RESTY_PCRE_VERSION}.tar.gz -o pcre-${RESTY_PCRE_VERSION}.tar.gz && tar xzf pcre-${RESTY_PCRE_VERSION}.tar.gz && curl -fSL https://openresty.org/download/openresty-${RESTY_VERSION}.tar.gz -o openresty-${RESTY_VERSION}.tar.gz && tar xzf openresty-${RESTY_VERSION}.tar.gz && cd /tmp/openresty-${RESTY_VERSION} && ./configure -j${RESTY_J} ${_RESTY_CONFIG_DEPS} ${RESTY_CONFIG_OPTIONS} ${RESTY_CONFIG_OPTIONS_MORE} && make -j${RESTY_J} && make -j${RESTY_J} install && cd /tmp && rm -rf openssl-${RESTY_OPENSSL_VERSION} openssl-${RESTY_OPENSSL_VERSION}.tar.gz openresty-${RESTY_VERSION}.tar.gz openresty-${RESTY_VERSION} pcre-${RESTY_PCRE_VERSION}.tar.gz pcre-${RESTY_PCRE_VERSION} && curl -fSL https://github.com/luarocks/luarocks/archive/${RESTY_LUAROCKS_VERSION}.tar.gz -o luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz && tar xzf luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz && cd luarocks-${RESTY_LUAROCKS_VERSION} && ./configure --prefix=/usr/local/openresty/luajit --with-lua=/usr/local/openresty/luajit --lua-suffix=jit-2.1.0-beta3 --with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1 && make build && make install && cd /tmp && rm -rf luarocks-${RESTY_LUAROCKS_VERSION} luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz && DEBIAN_FRONTEND=noninteractive apt-get autoremove -y && ln -sf /dev/stdout /usr/local/openresty/nginx/logs/access.log && ln -sf /dev/stderr /usr/local/openresty/nginx/logs/error.log
17
17
  export PATH=$PATH:/usr/local/openresty/luajit/bin/:/usr/local/openresty/nginx/sbin/:/usr/local/openresty/bin/
18
- echo "export PATH=$PATH:/usr/local/openresty/luajit/bin/:/usr/local/openresty/nginx/sbin/:/usr/local/openresty/bin/" >> ~/.bashrc
18
+ echo 'export PATH=$PATH:/usr/local/openresty/luajit/bin/:/usr/local/openresty/nginx/sbin/:/usr/local/openresty/bin/' >> ~/.bashrc
@@ -5,8 +5,8 @@ class Dockerfile2bash
5
5
  attr_reader :commands
6
6
  attr_accessor :content
7
7
 
8
- VERSION = '0.1.6'
9
- FIELDS = %w(from user run add copy arg env expose cmd onbuild)
8
+ VERSION = '0.1.7'
9
+ INSTRUCTIONS = %w(from user run add copy arg env expose cmd onbuild workdir entrypoint)
10
10
 
11
11
  def initialize(dockerfile)
12
12
  @dockerfile = dockerfile
@@ -23,13 +23,13 @@ class Dockerfile2bash
23
23
  next if /^\s*$/ =~ line
24
24
  next if /^\s*#/ =~ line
25
25
  segments = line.split(" ", 2)
26
- next if segments.length < 2 || !FIELDS.include?(segments[0].downcase)
26
+ next if segments.length < 2 || !INSTRUCTIONS.include?(segments[0].downcase)
27
27
 
28
28
  case segments[0].downcase!
29
- when "from", "user", "run", "expose", "copy", "add"
29
+ when "from", "user", "run", "expose", "copy", "add", "workdir"
30
30
  @commands << { segments[0] => segments[1] }
31
- when "cmd"
32
- @commands << { "cmd" => (JSON.parse(segments[1]) || []).join(" ") }
31
+ when "entrypoint", "cmd"
32
+ @commands << { segments[0] => JSON.parse(segments[1]) || [] }
33
33
  when "arg"
34
34
  args = segments[1].split("=", 2)
35
35
  if args.length == 2
@@ -78,7 +78,7 @@ class Dockerfile2bash
78
78
  when "env"
79
79
  env_str = "export " << cmd["env"]
80
80
  bash << env_str << "\n"
81
- bash << "echo \'#{env_str}\' >> ~/.bashrc" << "\n"
81
+ bash << "echo #{env_str.inspect} >> ~/.bashrc" << "\n"
82
82
  end
83
83
  end
84
84
  bash
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dockerfile2bash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - B1nj0y