Docker build simplification

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Docker build simplification

Dave Page-7
The attached patch simplifies the Docker container build so that it can be done entirely using "docker build" in the root of a source tree. It also enables building the container from a tarball, not just a git checkout. This does mean that container builds may now also include any garbage in the source tree from which they're built, but conversely offers the benefit of making it easy to build a container with code changes in it without having to commit first.

Akshay, can you look it over to make sure I haven't done anything obviously stupid? Feedback from others is also welcome of course.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

docker_simplification.patch (25K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Docker build simplification

Ashesh Vashi

On Tue, Sep 10, 2019 at 11:21 PM Dave Page <[hidden email]> wrote:

The attached patch simplifies the Docker container build so that it can be done entirely using "docker build" in the root of a source tree. It also enables building the container from a tarball, not just a git checkout. This does mean that container builds may now also include any garbage in the source tree from which they're built, but conversely offers the benefit of making it easy to build a container with code changes in it without having to commit first.

Akshay, can you look it over to make sure I haven't done anything obviously stupid? Feedback from others is also welcome of course.
Dave,

Is there any reason - we're not using the requirements.txt from the docker file, and installing the packages separately.

-- Thanks, Ashesh 

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Reply | Threaded
Open this post in threaded view
|

Re: Docker build simplification

Dave Page-7


On Wed, Sep 11, 2019 at 6:59 AM Ashesh Vashi <[hidden email]> wrote:

On Tue, Sep 10, 2019 at 11:21 PM Dave Page <[hidden email]> wrote:

The attached patch simplifies the Docker container build so that it can be done entirely using "docker build" in the root of a source tree. It also enables building the container from a tarball, not just a git checkout. This does mean that container builds may now also include any garbage in the source tree from which they're built, but conversely offers the benefit of making it easy to build a container with code changes in it without having to commit first.

Akshay, can you look it over to make sure I haven't done anything obviously stupid? Feedback from others is also welcome of course.
Dave,

Is there any reason - we're not using the requirements.txt from the docker file, and installing the packages separately.

I'm not sure what you mean. It installs Python dependencies in two places;

- In the documentation builder intermediate container. This doesn't use requirements.txt, and installs just the bare minimum required to install the docs.

- In the final container. This does use requirements.txt.

I suppose there's a minor simplification that can be made to the way I'm installing the requirements.txt file itself. At the moment it gets copied to the app builder, and then from there to the final container. I don't think it's actually needed in the app builder so I could just copy it from the host straight into the final container.

Or did you mean something else?
 
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Reply | Threaded
Open this post in threaded view
|

Re: Docker build simplification

Akshay Joshi
Hi Dave

I have installed docker, applied your patch and run "docker build .". Image has been created without REPOSITORY and TAG is this OK. 
Screenshot 2019-09-13 at 12.22.57 PM.png

Rest I have tested it works fine.

On Wed, Sep 11, 2019 at 4:44 PM Dave Page <[hidden email]> wrote:


On Wed, Sep 11, 2019 at 6:59 AM Ashesh Vashi <[hidden email]> wrote:

On Tue, Sep 10, 2019 at 11:21 PM Dave Page <[hidden email]> wrote:

The attached patch simplifies the Docker container build so that it can be done entirely using "docker build" in the root of a source tree. It also enables building the container from a tarball, not just a git checkout. This does mean that container builds may now also include any garbage in the source tree from which they're built, but conversely offers the benefit of making it easy to build a container with code changes in it without having to commit first.

Akshay, can you look it over to make sure I haven't done anything obviously stupid? Feedback from others is also welcome of course.
Dave,

Is there any reason - we're not using the requirements.txt from the docker file, and installing the packages separately.

I'm not sure what you mean. It installs Python dependencies in two places;

- In the documentation builder intermediate container. This doesn't use requirements.txt, and installs just the bare minimum required to install the docs.

- In the final container. This does use requirements.txt.

I suppose there's a minor simplification that can be made to the way I'm installing the requirements.txt file itself. At the moment it gets copied to the app builder, and then from there to the final container. I don't think it's actually needed in the app builder so I could just copy it from the host straight into the final container.

Or did you mean something else?
 
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


--
Thanks & Regards
Akshay Joshi
Sr. Software Architect
EnterpriseDB Software India Private Limited
Mobile: +91 976-788-8246
Reply | Threaded
Open this post in threaded view
|

Re: Docker build simplification

Dave Page-7
Hi Akshay,

On Fri, Sep 13, 2019 at 7:59 AM Akshay Joshi <[hidden email]> wrote:
Hi Dave

I have installed docker, applied your patch and run "docker build .". Image has been created without REPOSITORY and TAG is this OK. 

Right - "docker build ." will not create any tags unless you include the -t option. I intentionally added the tags to the Makefile target though.
 
Screenshot 2019-09-13 at 12.22.57 PM.png

Rest I have tested it works fine.

Thanks!
 
On Wed, Sep 11, 2019 at 4:44 PM Dave Page <[hidden email]> wrote:


On Wed, Sep 11, 2019 at 6:59 AM Ashesh Vashi <[hidden email]> wrote:

On Tue, Sep 10, 2019 at 11:21 PM Dave Page <[hidden email]> wrote:

The attached patch simplifies the Docker container build so that it can be done entirely using "docker build" in the root of a source tree. It also enables building the container from a tarball, not just a git checkout. This does mean that container builds may now also include any garbage in the source tree from which they're built, but conversely offers the benefit of making it easy to build a container with code changes in it without having to commit first.

Akshay, can you look it over to make sure I haven't done anything obviously stupid? Feedback from others is also welcome of course.
Dave,

Is there any reason - we're not using the requirements.txt from the docker file, and installing the packages separately.

I'm not sure what you mean. It installs Python dependencies in two places;

- In the documentation builder intermediate container. This doesn't use requirements.txt, and installs just the bare minimum required to install the docs.

- In the final container. This does use requirements.txt.

I suppose there's a minor simplification that can be made to the way I'm installing the requirements.txt file itself. At the moment it gets copied to the app builder, and then from there to the final container. I don't think it's actually needed in the app builder so I could just copy it from the host straight into the final container.

Or did you mean something else?
 
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


--
Thanks & Regards
Akshay Joshi
Sr. Software Architect
EnterpriseDB Software India Private Limited
Mobile: +91 976-788-8246


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company