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 3.2 changes #641

Open
wants to merge 4 commits into
base: master
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
1 change: 1 addition & 0 deletions customize/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ COPY packer.lua /packer.lua

USER root

RUN cp /usr/local/lib/luarocks/rocks-5.1/luarocks/3.9.2-1/bin/luarocks-admin /usr/local/bin/
RUN /usr/local/openresty/luajit/bin/luajit /packer.lua -- "$INJECTED_PLUGINS"

FROM ${KONG_BASE}
Expand Down
11 changes: 10 additions & 1 deletion customize/packer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ local function prep_platform()
stderr("WARNING: no platform match!")
end

local function file_exists(name)
local f = io.open(name, "r")
return f ~= nil and io.close(f)
end

local function is_empty_file(filename)
local t = readfile(filename)
Expand Down Expand Up @@ -328,7 +332,12 @@ end


header("Write new entry-point script")
assert(exec("mv /docker-entrypoint.sh /old-entrypoint.sh"))
if file_exists("/docker-entrypoint.sh")
then
assert(exec("mv /docker-entrypoint.sh /old-entrypoint.sh")) -- for old version
else
assert(exec("mv /entrypoint.sh /old-entrypoint.sh")) -- for new version
end
local entrypoint = [=[
#!/bin/sh
set -e
Expand Down