Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/docker/custom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,13 @@ fn docker_tag_name(file_name: &str) -> String {

// in case our result ends in an invalid last char `-` or `.`
// we remove
result = result.trim_end_matches(&['.', '-']).to_owned();
// in case our result starts in a `_`, we trim it
// as this otherwise clashes with the `-` prefix, leading to
// the invalid sequence `-_`
result = result
.trim_end_matches(['.', '-'])
.trim_start_matches(['.', '_'])
.to_owned();

// in case all characters were invalid or we had all non-ASCII
// characters followed by a `-` or `.`, we use a non-empty filename
Expand Down
Loading