Skip to content

Write or improve code samples #22549

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

Open
1 task done
sarahsanders-docker opened this issue May 1, 2025 · 11 comments
Open
1 task done

Write or improve code samples #22549

sarahsanders-docker opened this issue May 1, 2025 · 11 comments
Assignees
Labels
area/api Relates to Docker API docs wtd-project Relates to WTD API docs project

Comments

@sarahsanders-docker
Copy link
Collaborator

Is this a docs issue?

  • My issue is about the documentation content or website

Type of issue

Other

Description

Identify an API endpoint missing a sample and write a cURL or Python example request and response.

Location

https://docs.docker.com/reference/

Suggestion

No response

@sarahsanders-docker sarahsanders-docker added the wtd-project Relates to WTD API docs project label May 1, 2025
@DeeptiN1
Copy link

DeeptiN1 commented May 4, 2025

Hi @sarahsanders-docker Please could you assign this to me? Thanks!

@davidmlentz
Copy link

✋ I'd like to contribute here, too.

@davidmlentz
Copy link

Endpoint: https://docs.docker.com/reference/api/engine/version/v1.49/#tag/Container/operation/ContainerList

Curl:
curl --unix-socket /var/run/docker.sock -X GET http://localhost/v1.49/containers/json

@sarahsanders-docker
Copy link
Collaborator Author

@davidmlentz that looks good!

@davidmlentz
Copy link

davidmlentz commented May 4, 2025

Endpoint:
https://docs.docker.com/reference/api/engine/version/v1.49/#tag/Container/operation/ContainerStop

Curl:
curl --unix-socket /var/run/docker.sock -X POST -v "http://localhost/v1.49/containers/%7Bid%7D/stop"

@davidmlentz
Copy link

davidmlentz commented May 4, 2025

Endpoint:
https://docs.docker.com/reference/api/engine/version/v1.49/#tag/Image/operation/ImagePrune

Curl:
curl --unix-socket /var/run/docker.sock -X POST "http://localhost/v1.49/images/prune" -H "Content-Type: application/json"

@DeeptiN1
Copy link

DeeptiN1 commented May 4, 2025

Container APIs:

Container logs | https://docs.docker.com/reference/api/engine/version/v1.49/#tag/Container/operation/ContainerLogs

curl --unix-socket /var/run/docker.sock -X GET http://localhost/v1.49/containers/{id}/logs

Export a container | https://docs.docker.com/reference/api/engine/version/v1.49/#tag/Container/operation/ContainerExport

curl --unix-socket /var/run/docker.sock -X GET http://localhost/v1.48/containers/{id}/export

Resize a container | https://docs.docker.com/reference/api/engine/version/v1.49/#tag/Container/operation/ContainerResize

curl --unix-socket /var/run/docker.sock -X POST -v http://localhost/v1.49/containers/{id}/resize

Start a container | https://docs.docker.com/reference/api/engine/version/v1.49/#tag/Container/operation/ContainerStart

curl --unix-socket /var/run/docker.sock -X POST -v http://localhost/v1.49/containers/{id}/start

Stop a container | https://docs.docker.com/reference/api/engine/version/v1.49/#tag/Container/operation/ContainerStop

curl --unix-socket /var/run/docker.sock -X POST -v http://localhost/v1.49/containers/{id}/stop

Attach to a container | https://docs.docker.com/reference/api/engine/version/v1.49/#tag/Container/operation/ContainerAttach

curl --unix-socket /var/run/docker.sock -X POST -v http://localhost/v1.49/containers/{id}/attach

Remove a container | https://docs.docker.com/reference/api/engine/version/v1.49/#tag/Container/operation/ContainerDelete

curl --unix-socket /var/run/docker.sock -X DELETE -v http://localhost/v1.49/containers/{id}/stop

Get an archive of a filesystem resource in a container | https://docs.docker.com/reference/api/engine/version/v1.49/#tag/Container/operation/ContainerArchive

curl --unix-socket /var/run/docker.sock -X PUT -v http://localhost/v1.49/containers/{id}/archive

@davidmlentz
Copy link

Endpoint: https://docs.docker.com/reference/api/engine/version/v1.49/#tag/Image/operation/ImageCreate

Curl:
curl --unix-socket /var/run/docker.sock -X POST "http://localhost/v1.49/images/create?fromImage={image}&tag={tag}"

@davidmlentz
Copy link

Endpoint: https://docs.docker.com/reference/api/engine/version/v1.49/#tag/Image/operation/ImageDelete

Curl:
curl --unix-socket /var/run/docker.sock -X DELETE "http://localhost/v1.49/images/%7Bname%7D"

@davidmlentz
Copy link

Endpoint: https://docs.docker.com/reference/api/engine/version/v1.49/#tag/Image/operation/ImageSearch
Curl: curl --unix-socket /var/run/docker.sock -X GET "http://localhost/v1.49/images/search?term={term}"

@davidmlentz
Copy link

Endpoint: https://docs.docker.com/reference/api/engine/version/v1.49/#tag/Image/operation/ImageList

Curl: curl --unix-socket /var/run/docker.sock -X GET "http://localhost/v1.49/images/json"

@sarahsanders-docker sarahsanders-docker added the area/api Relates to Docker API docs label May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Relates to Docker API docs wtd-project Relates to WTD API docs project
Projects
Status: Todo
Development

No branches or pull requests

3 participants