.nh
.TH "DOCKER" "1" "May 2024" "Docker Community" "Docker User Manuals"

.SH NAME
.PP
docker-exec - Execute a command in a running container


.SH SYNOPSIS
.PP
\fBdocker exec [OPTIONS] CONTAINER COMMAND [ARG...]\fP


.SH DESCRIPTION
.PP
Alias for \fBdocker container exec\fR\&.


.SH OPTIONS
.PP
\fB-d\fP, \fB--detach\fP[=false]
	Detached mode: run command in the background

.PP
\fB--detach-keys\fP=""
	Override the key sequence for detaching a container

.PP
\fB-e\fP, \fB--env\fP=
	Set environment variables

.PP
\fB--env-file\fP=
	Read in a file of environment variables

.PP
\fB-h\fP, \fB--help\fP[=false]
	help for exec

.PP
\fB-i\fP, \fB--interactive\fP[=false]
	Keep STDIN open even if not attached

.PP
\fB--privileged\fP[=false]
	Give extended privileges to the command

.PP
\fB-t\fP, \fB--tty\fP[=false]
	Allocate a pseudo-TTY

.PP
\fB-u\fP, \fB--user\fP=""
	Username or UID (format: "[:]")

.PP
\fB-w\fP, \fB--workdir\fP=""
	Working directory inside the container


.SH SEE ALSO
.PP
\fBdocker(1)\fP
