Write or improve code samples
Is this a docs issue?
- [x] 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
Hi @sarahsanders-docker Please could you assign this to me? Thanks!
✋ I'd like to contribute here, too.
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
@davidmlentz that looks good!
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/{id}/stop"
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"
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
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}"
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/{name}"
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}"
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"