Last active
January 7, 2018 20:44
-
-
Save TylerLeonhardt/1a0cec288e21b98fda576317b8bcb106 to your computer and use it in GitHub Desktop.
A crazy dockerfile for testing the PowerShell extension for VSCode on CentOS - using CentOS 7, xfce, vnc, PowerShell, VSCode
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 consol/centos-xfce-vnc | |
USER root | |
# Get PowerShell | |
RUN sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc.2/powershell-6.0.0_rc.2-1.rhel.7.x86_64.rpm -y | |
# Get git | |
RUN sudo yum install git -y | |
# Get VSCode | |
RUN sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc && \ | |
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo' && \ | |
yum update -y && \ | |
sudo yum install code -y | |
# Set to non-root user | |
RUN useradd -G wheel docker | |
RUN echo "root" | passwd docker --stdin | |
RUN sudo chown -R docker: $HOME | |
USER docker | |
# Install PowerShell extension | |
RUN code --install-extension ms-vscode.powershell | |
# Steps: | |
# download this docker file to a directory | |
# cd into that directory | |
# docker build . -t vscode-powershell-centos-devkit:0.0.1 -f VSCodePowerShellCentOSDockerfile | |
# docker run -it -p 5901:5901 vscode-powershell-centos-devkit:0.0.1 | |
# Open up your favorite VNC client and connect to localhost:5901 | |
# The default vnc connection password is vncpassword | |
# The default user "docker" has a password of "root" | |
# You're ready to go! | |
# Will be on Docker Hub soon! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
when doing docker build, I get following output, returning a non-zero code:
docker build . -t vscode-powershell-centos-devkit:0.0.1 -f VSCodePowerShellCentOSDockerfile
Sending build context to Docker daemon 3.072kB
Step 1/10 : FROM consol/centos-xfce-vnc
---> c663163597b0
Step 2/10 : USER root
---> Using cache
---> 93de26fc3be0
Step 3/10 : RUN sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc.2/powershell-6.0.0_rc.2-1.rhel.7.x86_64.rpm -y
---> Using cache
---> e01b7935ca99
Step 4/10 : RUN sudo yum install git -y
---> Using cache
---> d2298b954d8f
Step 5/10 : RUN sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc && sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo' && yum check-update && sudo yum install code -y
---> Running in 7916970b4e63
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
dracut.x86_64 033-502.el7_4.1 updates
The command '/bin/sh -c sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc && sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo' && yum check-update && sudo yum install code -y' returned a non-zero code: 100