-
-
Save TylerLeonhardt/1a0cec288e21b98fda576317b8bcb106 to your computer and use it in GitHub Desktop.
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! |
Also I don't seem to get notifications when people post here - if you have trouble, find me on Twitter (@TylerLeonhardt) 🙂
While trying to run, I am getting the error:
docker run -it -p 5901:5901 vscode-powershell-centos-devkit:0.0.1
Unable to find image 'vscode-powershell-centos-devkit:0.0.1' locally
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: pull access denied for vscode-powershell-centos-devkit, repository does not exist or may require 'docker login'.
See 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe run --help'.
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
- base: centos.excellmedia.net
- epel: kartolo.sby.datautama.net.id
- epel-testing: kartolo.sby.datautama.net.id
- extras: centos.excellmedia.net
- updates: centos.excellmedia.net
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
Ah! Just saw this. I added the default password in the Dockerfile :)