Skip to content

Allow backwards-compatible colon syntax for tags in 'commit' command#2450

Closed
binaryphile wants to merge 1 commit intomoby:masterfrom
binaryphile:master
Closed

Allow backwards-compatible colon syntax for tags in 'commit' command#2450
binaryphile wants to merge 1 commit intomoby:masterfrom
binaryphile:master

Conversation

@binaryphile
Copy link
Copy Markdown

Hi there,

I'm not a go programmer, just a docker user. I've been foiled by the inconsistent syntax of the "commit" command many times, even though I'm aware of it. The command doesn't use the colon-based tag syntax used by, I believe, every other command in the docker repertoire.

What happens is that when you accidentally use the commit command with a colon to designate the tag name, docker happily creates a repository where the repository name includes a colon. This is clearly not the user's intent, and it renders the image name unusable by the rest of the docker commands. For example, you cannot then remove the image by name, since the rmi command interprets the colon-based name correctly, and can't find the repository with the colon in the repository name. You must use look up the image id and can only remove it by id.

The pull request here is simply my best guess at modifying the commit command to correctly determine that the user intended to create a tag name with the colon-based syntax. It first tests to see that there is no formal tag argument, then tests to see if there is a colon in the repository name. If so, it reparses the repository and tag arguments by splitting the repository string on colon.

I can't even compile this as I don't have the go language environment set up. I'm submitting this to spark a conversation, not necessarily provide the solution. I did make a good faith effort to use the proper syntax, however, so I wouldn't be entirely surprised if the code actually worked.

If you guys could fix this, it would make me so happy. Thanks!

@dudebout
Copy link
Copy Markdown
Contributor

I ran into this problem as well.

@crosbymichael
Copy link
Copy Markdown
Contributor

Me too

Michael Crosby

On Oct 29, 2013, at 1:02 PM, Nicolas Dudebout [email protected] wrote:

I ran into this problem as well.


Reply to this email directly or view it on GitHub.

@vieux
Copy link
Copy Markdown
Contributor

vieux commented Oct 29, 2013

couldn't we do the same as a quick fix for docker tag ?

@SvenDowideit
Copy link
Copy Markdown
Contributor

yup - though this PR probably isn't right :) (sorry @binaryphile ), as there's a utils.ParseRepositoryTag that I'm using :)

@binaryphile
Copy link
Copy Markdown
Author

More than happy to have a better pull request.

cpuguy83 pushed a commit to cpuguy83/docker that referenced this pull request May 25, 2021
Always configure iptables forward policy
cpuguy83 pushed a commit to cpuguy83/docker that referenced this pull request May 25, 2021
Reverts 141b53c (PR moby#2450)

Fallout from changing the forwarding default policy to deny was greater than anticipated.

Signed-off-by: Euan Harris <[email protected]>
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.

5 participants