├── .gitignore ├── DayZConfig └── tmp ├── DayZDockerServer ├── Dockerfile └── run.ps1 ├── DayZMission └── tmp ├── DayZProfiles └── tmp ├── Readme.md └── docker-compose.yml /.gitignore: -------------------------------------------------------------------------------- 1 | /DayZDockerServer/X3DAudio1_7.dll 2 | /DayZDockerServer/XAPOFX1_5.dll 3 | /DayZConfig/** 4 | /DayZProfiles/** 5 | /DayZMission/** -------------------------------------------------------------------------------- /DayZConfig/tmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ssashir06/DayZDockerServer/606b41c7392a49b6088e7a60d03e1e3cb8195a15/DayZConfig/tmp -------------------------------------------------------------------------------- /DayZDockerServer/Dockerfile: -------------------------------------------------------------------------------- 1 | #escape=` 2 | ARG tag=1809 3 | 4 | ## get steamcmd.zip and extract 5 | FROM mcr.microsoft.com/windows/servercore:${tag} AS builder 6 | SHELL ["PowerShell.exe", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] 7 | WORKDIR C:\Installer 8 | ### Install Microsoft Visual C++ 2015 Redistributable Update 3 9 | ADD https://download.microsoft.com/download/0/6/4/064F84EA-D1DB-4EAA-9A5C-CC2F0FF6A638/vc_redist.x64.exe vc_redist.x64.exe 10 | RUN Start-Process -FilePath '.\vc_redist.x64.exe' -ArgumentList '/install /passive /norestart' -Wait; 11 | ### Install DirectX (for XAPOFX1_5.dll) 12 | ADD https://download.microsoft.com/download/1/7/1/1718CCC4-6315-4D8E-9543-8E28A4E18C4C/dxwebsetup.exe dxwebsetup.exe 13 | RUN Start-Process -FilePath '.\dxwebsetup.exe' -ArgumentList '/Q' -Wait; 14 | ### Setting up steamcmd.exe 15 | ADD https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip steamcmd.zip 16 | RUN Expand-Archive -Path steamcmd.zip ; ` 17 | $ErrorActionPreference='Continue'; ` 18 | & steamcmd\steamcmd.exe +quit ; ` 19 | Exit-PSSession ; 20 | ### Login and install DayZ Server .. 21 | ARG steamlogin 22 | ARG steampasswd 23 | ARG steamguard= 24 | ENV steamlogin=${steamlogin} 25 | ENV steampasswd=${steampasswd} 26 | ENV steamguard=${steamguard} 27 | RUN Write-Output "LOGIN:$ENV:steamlogin" ; ` 28 | & steamcmd\steamcmd.exe +login $ENV:steamlogin $ENV:steampasswd $ENV:steamguard +force_install_dir C:\DayZServer +app_update 223350 +quit ; 29 | 30 | ## setting up server 31 | FROM mcr.microsoft.com/windows/servercore:${tag} AS server 32 | SHELL ["PowerShell.exe", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] 33 | COPY --from=builder C:\windows\system32\msvcp140.dll C:\windows\system32 34 | COPY --from=builder C:\windows\system32\vcruntime140.dll C:\windows\system32 35 | COPY --from=builder C:\DayZServer C:\DayZServer 36 | COPY run.ps1 C:\DayZServer 37 | COPY X3DAudio1_7.dll C:\DayZServer 38 | COPY XAPOFX1_5.dll C:\DayZServer 39 | 40 | VOLUME C:\DayZProfiles 41 | VOLUME C:\DayZConfig 42 | VOLUME C:\DayZMission 43 | 44 | WORKDIR C:\DayZServer 45 | EXPOSE 2302/tcp 27015-27030/tcp 27036-27037/tcp 2302/udp 4380/udp 27000-27031/udp 27036/udp 46 | ENTRYPOINT [ "PowerShell.exe", "-Command", "C:\\DayZServer\\run.ps1" ] -------------------------------------------------------------------------------- /DayZDockerServer/run.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = 'Stop'; 2 | Set-Location C:\DayZServer\ ; 3 | 4 | # copy config file 5 | if (-Not(Test-Path -Path C:\DayZConfig\serverDZ.cfg)) { 6 | Write-Host 'Copying default configuration'; 7 | Copy-Item -Path .\serverDZ.cfg -Destination C:\DayZConfig\ ; 8 | } 9 | 10 | # copy mission file and make a link 11 | if (-Not(Test-Path -Path C:\DayZMission\mpmissions)) { 12 | Write-Host 'Copying default mpmissions'; 13 | Copy-Item -Path .\mpmissions -Destination C:\DayZMission\mpmissions -Recurse; 14 | } 15 | Remove-Item -Recurse .\mpmissions ; 16 | New-Item -ItemType Junction -Path .\mpmissions -Value C:\DayZMission\mpmissions ; 17 | 18 | # start server 19 | try { 20 | Write-Host 'Start DayZ Docker Server.'; 21 | & .\DayZServer_x64.exe -config=C:\DayZConfig\serverDZ.cfg -profiles=C:\DayZProfiles -port=2302 -dologs -adminlog -netlog -freezecheck; 22 | Wait-Process -Name DayZServer_x64 ; 23 | } catch { 24 | throw; 25 | } finally { 26 | Write-Host 'End DayZ Docker Server'; 27 | } -------------------------------------------------------------------------------- /DayZMission/tmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ssashir06/DayZDockerServer/606b41c7392a49b6088e7a60d03e1e3cb8195a15/DayZMission/tmp -------------------------------------------------------------------------------- /DayZProfiles/tmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ssashir06/DayZDockerServer/606b41c7392a49b6088e7a60d03e1e3cb8195a15/DayZProfiles/tmp -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # Description 2 | Running DayZ Server on Docker. 3 | 4 | # Requirements 5 | - Your Steam account 6 | - Docker Desktop 7 | - Windows 10 version 1809 or above 8 | 9 | # Usage 10 | ## Preparation 11 | Copy X3DAudio1_7.dll and XAPOFX1_5.dll to the Dockerfile's directory from your PC. They are located in the C:\Windows\System32. 12 | ## Build image 13 | To start setting up DayZ Server container image, in this directory, please run this command. 14 | ```ps1 15 | docker-compose build --build-arg steamlogin=STEAM_USERNAME --build-arg steampasswd=STEAM_PASSWORD --build-arg steamguard=STEAM_GUARD 16 | ``` 17 | - This command is including several arguments (STEAM_USERNAME, STEAM_PASSWD, STEAM_GUARD) to login and download, so please replace it to your steam account. 18 | - This might cause error because the steam guard can be expired while this install process. 19 | - By default, this install process will use Windows Server Core 1809 to use process isolation. If your environment is not this, it can be customized by using 'tag' build argument. (See the Full Tag Listing section: https://hub.docker.com/_/microsoft-windows-servercore ) 20 | 21 | ## Run server 22 | To start the DayZ Server in the docker container, please run these commands. 23 | ```ps1 24 | docker-compose up -d 25 | ``` 26 | After running this command, you can connect to local server by using 172.16.238.99:2302. 27 | In addition, Using Dayz Launcher is easier to use because it can specify the server IP address. 28 | 29 | ## Stop server 30 | To stop the running DayZ Server in the docker container, please run these commands. 31 | ```ps1 32 | docker-compose down 33 | ``` 34 | 35 | # Notification 36 | Please do not make the server's image public like in DockerHub because it contains licensed files of DayZ Server. 37 | 38 | # Current issues 39 | X3DAudio1_7.dll and XAPOFX1_5.dll cannot be copied from build image, because of the installation of DirectX failure. 40 | 41 | # TODO 42 | - Creating a volume to customize configuration. 43 | 44 | # Links 45 | - https://community.bistudio.com/wiki/DayZ:Server_Configuration 46 | - https://developer.valvesoftware.com/wiki/Command_Line_Options#SteamCMD 47 | - https://write.corbpie.com/installing-and-setting-up-a-dayz-standalone-server-on-windows-server-2016-guide/ 48 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2.4' 2 | services: 3 | server: 4 | build: 5 | context: .\DayZDockerServer 6 | args: 7 | - steamlogin 8 | - steampasswd 9 | - steamguard 10 | isolation: process 11 | networks: 12 | app_net: 13 | ipv4_address: 172.16.238.99 14 | volumes: 15 | - .\DayZProfiles:C:\DayZProfiles 16 | - .\DayZConfig:C:\DayZConfig 17 | - .\DayZMission:C:\DayZMission 18 | networks: 19 | app_net: 20 | driver: nat 21 | ipam: 22 | driver: default 23 | config: 24 | - subnet: 172.16.238.0/24 25 | gateway: 172.16.238.1 26 | volumes: 27 | DayZProfiles: 28 | DayZConfig: 29 | DayZMission: --------------------------------------------------------------------------------