forked from tern-tools/tern
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace manual dfile parser with dockerfile-parse
This is a large commit that removes unnecessary manual parsing from tern/analyze/docker/dockerfile.py so that other parts of the code can utilize the built-in parsing abilities from the DockerfileParse module. While many of the changes from this commit remove no longer necessary functions, a few helper functions were also added. Functions Removed: - get_command_list() - get_directive() - get_directive_list() - get_base_instructions() - get_base_image_tag() Functions Added: - update_parent_images( If the FROM line in a Dockerfile contains a variable previously defined by the ARG command, the function expand_arg will take care of the replacement and update the dockerfile object structure. When this happens, we also need to update the parent_images list property of the Dockerfile object in case one of the ARG variables is part of the FROM line. - get_command_list() Returns a list of commands from the dockerfile object structure provided. Useful when it's unrealistic to loop through the entire dictionary looking for a certain command. Resolves tern-tools#522 Signed-off-by: Rose Judge <[email protected]>
- Loading branch information
Showing
1 changed file
with
24 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters