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
#180 multistage build on master branch #211
Conversation
smellman
commented
Oct 31, 2020
- Optimize master dockerfile #180 multistage build on master branch
Dockerfile.master.template
Outdated
@@ -1,4 +1,4 @@ | |||
FROM postgres:%%PG_MAJOR%% | |||
FROM debian:%%DEBIAN_VERSION%% as builder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question:
- It is possible to use - same base image as in the second stage ?
imho: it will be more secure;
Extreme case: when somebody building manually .. or just reuse this Docker script ..
- postgres:13 pulled the latest .. but the base debian is not refreshed the same time.
Or there are a few day difference in the upstream "debian" and "postgres:13" ..
so the "postgres:13" base layer is older version ..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which is better, "postgres:12" or "postgres:13"?
I think Multistage build is useful for speed up building both 12-master and 13-master so I use debian:buster-slim
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, Original comment is not focus the speed.
OK, I will change code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I change my code but this postgis hash may fail in test so I change this PR to Draft.
Run tests: 143
Failed: 1
make: *** [runtest.mk:10: check-regress] Error 1
@ImreSamu Do you check current source code? |
(based on the travis log ) imho: The postgis git hash is very strange.
maybe the
imho ( temporary ) :
|
It only pull specify hashed branch as one commit.
I use it but I get same error in build. |
Sorry I find the bug in my code. |
@ImreSamu I try to build current 12-master.
I think postgres:12 image was changed something. |
imho: # Checkout the Postgis 2.0.0 version ( Apr 3, 2012 )
# https://github.com/postgis/postgis/releases/tag/2.0.0
# https://github.com/postgis/postgis/commit/731e89549040556a4d693d3c05c1c8221c055157
export POSTGIS_GIT_HASH=731e89549040556a4d693d3c05c1c8221c055157
mkdir postgis_test_fetch_head
cd postgis_test_fetch_head
git init
git remote add origin https://git.osgeo.org/gitea/postgis/postgis.git
git fetch --depth 1 origin :${POSTGIS_GIT_HASH}
git reset --hard FETCH_HEAD
head NEWS
# Classic
cd ..
git clone --branch master https://git.osgeo.org/gitea/postgis/postgis.git
cd postgis
git checkout ${POSTGIS_GIT_HASH}
head NEWS
the first
|
If you modify for the "classic"
|
@ImreSamu I tries it.
|
@ImreSamu I test with old master branches of proj, geos and gdal. PostGIS current master branch can build if use old branches of proj and geos. |
GEOS issue may fixed: postgis/postgis@4ec4fbc |
I write PROJ issue: https://trac.osgeo.org/postgis/ticket/4785 |
it is good news !
and thanks for searching the root cause My question: |
It only 4MB smaller than current posgis-master. But I think it is useful for debug to research root cause. |
I checked postgis current master was fixed this. |
@ImreSamu Proj issue was fixed postgis/postgis@5b2e3cb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smellman: Thank you !
I have some "not critical" comments ..
Dockerfile.master.template
Outdated
sqlite3 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /usr/local |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: This WORKDIR is important for the COPY ?
@@ -1,18 +1,10 @@ | |||
FROM postgres:%%PG_MAJOR%% | |||
FROM postgres:%%PG_MAJOR%% as builder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imho: Please add some Warning comment to the top of the master Dockerfile;
At least an "experimental" warning ..
~ like
# "experimental" ; only for testing!
# multi-stage dockerfile; minimal docker version >= 17.05
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you comments.
I resolve all comments.
@smellman :
|