Last active
April 5, 2021 15:49
-
-
Save dangtrinhnt/b6004667a2fcf1960ca53819fe662752 to your computer and use it in GitHub Desktop.
Sample Windows container Dockerfile running a Java application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM mcr.microsoft.com/windows/servercore:ltsc2019 | |
# everything will be installed inside this directory inside the container | |
WORKDIR "C:/ProgramData" | |
# install chocolately package manager | |
RUN @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" -Y | |
RUN choco install openjdk8 -Y | |
RUN refreshenv | |
ADD myapplication.war "C:/ProgramData" | |
EXPOSE 8080 | |
CMD ["java", "-jar", "C:/ProgramData/myapplication.war"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment