-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
It should be possible to explicit name images and containers #541
Comments
Maybe related:
Maybe being able to configure image name will fix this. |
@kolen I believe you are mistaken. A directory name with an uppercase letter is just fine. Fig will normalize the project name if it contains non-alphanumeric characters. That error string does not appear in the fig codebase at all. I see that string in Do you have an |
I'm experiencing the same invalid repository message as kolen, and only when the directory containing fig.yml has a name with an uppercase letter. This started occurring after upgrading to docker 1.3.0. Happens with both fig 0.5.2 and 1.0. |
I can confirm this as well. Docker 1.3.0, boot2docker 1.3.0, fig 1.0. Didn't have a problem with fig 0.5.2 and Docker / boot2docker 1.2.0. The directory name I was using was called "Docker". I renamed the directory so it starts with a lowercase character and even added a prefix, like "project-docker" and now it works. Fig does seem to remove the - (it gives the images a prefix of projectdocker_), so it does something, but it doesn't change case. BTW, I'm on OS X. |
@dnephin I have As I discovered, project name is normalized in get_project_name: def get_project_name(self, config_path, project_name=None):
def normalize_name(name):
return re.sub(r'[^a-zA-Z0-9]', '', name)
# ... Changing it to diff --git a/fig/cli/command.py b/fig/cli/command.py
index 743c96e..16d02e6 100644
--- a/fig/cli/command.py
+++ b/fig/cli/command.py
@@ -81,7 +81,7 @@ class Command(DocoptCommand):
def get_project_name(self, config_path, project_name=None):
def normalize_name(name):
- return re.sub(r'[^a-zA-Z0-9]', '', name)
+ return re.sub(r'[^a-zA-Z0-9]', '', name).lower()
project_name = project_name or os.environ.get('FIG_PROJECT_NAME')
if project_name is not None: temporarily fixes the problem (at least for directories with uppercase characters — tried, it works, after this change fig builds my project). |
Aha, thanks for the extra details! It seems that this is another non-backwards compatible change to the Docker remote API with 1.3. I think this might be related to this change moby/moby@aabba98. |
👍 It's very common that you want to create a new image for deployment from time to time. So you need a way to give that image a new version tag. As I see it, the only workaround is not to use |
Related to this the automaticly generated image names produces invalid hostnames when used with skydock/skydns. I will likewise look at skydock to see if it's parameterizable how to pick the hostnames of the containers. It currently uses I'm successfully following @mikehaertl 's workaround to build manually with docker and then executing the images from fig. |
@funkyfuture : yes, you are right.. Seems like tagging images is covered by #457 and naming containers are tagged by #652. This one can be closed. |
No, naming images is still don't supported, and #457 doesn't seem to be the same use case... |
I am aware of ongoing discussion about "The project name should be configurable", #45"
However, I think it should be easy to simply name and tag images and containers explicitly, like this:
The text was updated successfully, but these errors were encountered: