docker / docs

Source repo for Docker's Documentation
https://docs.docker.com
Apache License 2.0
4.19k stars 7.35k forks source link

Install using apt repository doesn't work for fish shell #20285

Open AyushSehrawat opened 5 months ago

AyushSehrawat commented 5 months ago

Is this a docs issue?

Type of issue

Other

Description

The [Install using the apt repository](https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository) section in documentations shows the commands to add docker repository to apt. Issue is that fish shell doesn't support $(...) syntax and gives error

image

Location

https://docs.docker.com/engine/install/ubuntu/

Suggestion

This can be solved by adding other shell tabs like for fish or bash can be forced to run on that single line using bash -c or just a mention to use bash -c in case using other shells

More than happy to make a pr for it :)

dvdksn commented 5 months ago

@thaJeztah you're a fish user right?

thaJeztah commented 5 months ago

I am; also enough of a Fish user to know that it's not very compatible with POSIX shells, and I usually don't expect such examples to be working without some changes 😅

I didn't try this one on Fish though, as my remote Linux machines tend to be a vanilla install without custom shell.

Not sure we should add a "bash -c" around the whole command to make it work with an incompatible shell (not sure if there's a good solution for this line that would work for both though)

we should document our conventions for examples to expect a posix(y) shells though.

AyushSehrawat commented 5 months ago

I am; also enough of a Fish user to know that it's not very compatible with POSIX shells, and I usually don't expect such examples to be working without some changes 😅

I didn't try this one on Fish though, as my remote Linux machines tend to be a vanilla install without custom shell.

Not sure we should add a "bash -c" around the whole command to make it work with an incompatible shell (not sure if there's a good solution for this line that would work for both though)

we should document our conventions for examples to expect a posix(y) shells though.

Yeah Bash and fish syntax doesn't always work. How about just a mention to use bash -c if not using posix(y) shells? Like a note or something

bash -c 'command....'

AyushSehrawat commented 5 months ago

@thaJeztah how about a notice like this?

https://cockpit-project.org/running.html#ubuntu

I was browsing through this project and found it. Something similar in documentation will be nice

docker-robot[bot] commented 2 months ago

There hasn't been any activity on this issue for a long time. If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment. If not, this issue will be closed in 14 days. This helps our maintainers focus on the active issues.

Prevent issues from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

AyushSehrawat commented 2 months ago

/remove-lifecycle stale