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

feat: add a "stacker convert" to convert a Dockerfile #349

Merged
merged 2 commits into from
Jan 9, 2023

Conversation

rchincha
Copy link
Contributor

@rchincha rchincha commented Dec 5, 2022

https://docs.docker.com/engine/reference/builder/

`
stacker help convert

help convert
NAME:
stacker-dynamic convert - converts a Dockerfile into a stacker yaml
file

USAGE:
stacker-dynamic convert [command options] [arguments...]

OPTIONS:
--Dockerfile value, -f value the input Dockerfile (default: "Dockerfile")
`

Signed-off-by: Ramkumar Chinchani rchincha@cisco.com

What type of PR is this?

Which issue does this PR fix:

What does this PR do / Why do we need it:

If an issue # is not available please add repro steps and logs showing the issue:

Testing done on this change:

Automation added to e2e:

Will this break upgrades or downgrades?

Does this PR introduce any user-facing change?:


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@rchincha rchincha force-pushed the dockerfile branch 12 times, most recently from 61ad5c4 to 7df4544 Compare December 9, 2022 18:51
@rchincha rchincha marked this pull request as ready for review December 9, 2022 19:04
@rchincha
Copy link
Contributor Author

rchincha commented Dec 9, 2022

Surprisingly, breaks here

not ok 30 bind rebuilds

(in test file test/caching.bats, line 151)

`out=$(stacker build --substitute bind_path=${bind_path} --substitute CENTOS_OCI=$CENTOS_OCI)' failed

@rchincha
Copy link
Contributor Author

rchincha commented Dec 9, 2022

and not here:
ok 41 convert a Dockerfile

@rchincha rchincha added this to the v0.40.2 milestone Dec 16, 2022
@rchincha rchincha force-pushed the dockerfile branch 6 times, most recently from 552fbff to 21f724c Compare December 21, 2022 21:27
@rchincha rchincha changed the title feat: add a "stacker convert" to convert a Dockerfile feat: add a "stacker convert" to convert a Dockerfile - DON'T MERGE Dec 21, 2022
@rchincha rchincha force-pushed the dockerfile branch 3 times, most recently from 4b5c4b2 to 6bde6ab Compare December 24, 2022 00:28
@rchincha
Copy link
Contributor Author

Lookup2: name:bind-test cache:map[]

TEST (binds): 1 [{/home/runner/work/stacker/stacker/stackertest-test_bind_rebuilds.78LQ7s/tree2/foo /root/tree2/foo}] hit: false

@rchincha rchincha force-pushed the dockerfile branch 5 times, most recently from 4a7bb17 to 78da872 Compare December 26, 2022 04:01
@rchincha rchincha force-pushed the dockerfile branch 8 times, most recently from 5077952 to dfde64f Compare January 7, 2023 23:31
@rchincha rchincha changed the title feat: add a "stacker convert" to convert a Dockerfile - DON'T MERGE feat: add a "stacker convert" to convert a Dockerfile Jan 8, 2023
@rchincha rchincha force-pushed the dockerfile branch 2 times, most recently from 4fe2bb9 to 352bec5 Compare January 9, 2023 01:41
@rchincha
Copy link
Contributor Author

rchincha commented Jan 9, 2023

alpine/edge gcc was updated with this recently.
https://git.alpinelinux.org/aports/commit/?id=4592d806b9c8832895c32aeb53936b345b04b500

Fails spectacularly ...
/usr/lib/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
lto-wrapper: warning: Extra option to '-Xassembler': --noexecstack, dropping all '-Xassembler' and '-Wa' options.
during IPA pass: static-var
lto1: internal compiler error: original not compressed with zstd
0x18df117 internal_error(char const*, ...)
???:0
0x9d23da lto_end_uncompression(lto_compression_stream*, lto_compression)
???:0
0x9d09a0 lto_get_section_data(lto_file_decl_data*, lto_section_type, char const*, int, unsigned long*, bool)
???:0
0x94ae28 symbol_table::remove_unreachable_nodes(_IO_FILE*)
???:0
0x68e897 read_cgraph_and_symbols(unsigned int, char const**)
???:0
0x67ab02 lto_main()
???:0
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See https://gitlab.alpinelinux.org/alpine/aports/-/issues for instructions.

@rchincha
Copy link
Contributor Author

rchincha commented Jan 9, 2023

Copy link
Contributor

@hallyn hallyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few questions below.

go.mod Outdated Show resolved Hide resolved
cmd/stacker/publish.go Show resolved Hide resolved
pkg/types/layer.go Show resolved Hide resolved
@rchincha rchincha force-pushed the dockerfile branch 2 times, most recently from 04a1d7f to 6861dee Compare January 9, 2023 19:59
Start with a subset of Dockerfile grammar.
(syntax version 1)

"""
stacker help convert

 help convert
NAME:
   stacker-dynamic convert - converts a Dockerfile into a stacker yaml
file

USAGE:
   stacker-dynamic convert [command options] [arguments...]

OPTIONS:
   --docker-file value, -i value      the input Dockerfile (default:
"Dockerfile")
   --output-file value, -o value      the output stacker file (default:
"stacker.yaml")
   --substitute-file value, -s value  the output file containing
detected substitutions (default: "stacker-subs.yaml")
"""

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
@rchincha rchincha merged commit c00511a into project-stacker:main Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants