Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Odoo scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XCG
Odoo scripts
Commits
7496aea7
Commit
7496aea7
authored
1 year ago
by
Vincent Hatakeyama
Browse files
Options
Downloads
Patches
Plain Diff
Use buildx to compile when installed
parent
73e4d97e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!204
📝 Adjust source_control section, mercurial is not needed directly
,
!203
✨ Replace docker-py by python_on_whales
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
NEWS.rst
+2
-0
2 additions, 0 deletions
NEWS.rst
odoo_scripts/docker_build.py
+17
-7
17 additions, 7 deletions
odoo_scripts/docker_build.py
with
19 additions
and
7 deletions
NEWS.rst
+
2
−
0
View file @
7496aea7
...
@@ -9,6 +9,8 @@
...
@@ -9,6 +9,8 @@
https://github.com/docker/docker-py/issues/2230
https://github.com/docker/docker-py/issues/2230
If buildx for docker is installed, use it to build.
20.14.0
20.14.0
-------
-------
...
...
This diff is collapsed.
Click to expand it.
odoo_scripts/docker_build.py
+
17
−
7
View file @
7496aea7
...
@@ -242,13 +242,23 @@
...
@@ -242,13 +242,23 @@
_logger
.
debug
(
"
Docker Pull %s
"
,
pull
)
_logger
.
debug
(
"
Docker Pull %s
"
,
pull
)
full_tags
=
[
repository
]
if
nmspc
.
local
else
[
f
"
{
repository
}
:
{
tag
}
"
for
tag
in
tags
]
full_tags
=
[
repository
]
if
nmspc
.
local
else
[
f
"
{
repository
}
:
{
tag
}
"
for
tag
in
tags
]
with
capture_docker_exit_code
()
as
exit_code
:
with
capture_docker_exit_code
()
as
exit_code
:
docker
.
image
.
build
(
if
docker
.
buildx
.
is_installed
():
context_path
=
"
.
"
,
_logger
.
info
(
"
Starting build with buildx
"
)
pull
=
pull
,
docker
.
buildx
.
build
(
build_args
=
buildargs
,
context_path
=
"
.
"
,
tags
=
full_tags
,
pull
=
pull
,
file
=
dockerfile
,
build_args
=
buildargs
,
)
tags
=
full_tags
,
file
=
dockerfile
,
)
else
:
docker
.
image
.
build
(
context_path
=
"
.
"
,
pull
=
pull
,
build_args
=
buildargs
,
tags
=
full_tags
,
file
=
dockerfile
,
)
if
dev
:
if
dev
:
call
([
"
rm
"
,
dockerfile
])
call
([
"
rm
"
,
dockerfile
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment