Don't miss out on new posts! Sign up! Also, visit the VHT Forums!
Docker desktop on w...
 
Notifications
Clear all

Docker desktop on windows server 2022 in AWS Ec2 instance

17 Posts
2 Users
2 Likes
615 Views
(@anshulkapoor)
Posts: 8
Active Member
Topic starter
 

Hi,

 

i tried the instructions you have me tioned in the video but I am getting the error while installing the package

Command

1. Install-Module -Name DockerMsftProvider -Force

2. Install-Package -Name docker -ProviderName DockerMsftProvider

 

error - Cannot find the path

image

 

 
Posted : 21/01/2024 3:23 pm
Brandon Lee reacted
Brandon Lee
(@brandon-lee)
Posts: 404
Member Admin
 

@anshulkapoor welcome to the VHT forums! I believe Microsoft has deprecated the Docker provider now in favor of containerd. I will take a look in my lab at the modified steps needed and report back here.

 
Posted : 21/01/2024 4:08 pm
Brandon Lee
(@brandon-lee)
Posts: 404
Member Admin
 

@anshulkapoor Can you use this command instead?

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/Windows-Containers/Main/helpful_tools/Install-DockerCE/install-docker-ce.ps1" -o install-docker-ce.ps1
.\install-docker-ce.ps1
 
Posted : 21/01/2024 4:52 pm
(@anshulkapoor)
Posts: 8
Active Member
Topic starter
 

Thanks for quick response 

i tried the same command i am able to invoke the web URL but while using complete command i am getting below error.

image

really appreciate you help 

 

 
Posted : 21/01/2024 7:18 pm
Brandon Lee
(@brandon-lee)
Posts: 404
Member Admin
 

@anshulkapoor Actually it looks like it is run together with the first line. Run this command first:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/Windows-Containers/Main/helpful_tools/Install-DockerCE/install-docker-ce.ps1" -o install-docker-ce.ps1

Then, run this command:

.\install-docker-ce.ps1
 
Posted : 21/01/2024 8:19 pm
(@anshulkapoor)
Posts: 8
Active Member
Topic starter
 

Thank you very much Brandon. This helped me to installed the docker on windows server 2022 in AWS ec2 instance 

 
Posted : 22/01/2024 9:56 am
Brandon Lee reacted
Brandon Lee
(@brandon-lee)
Posts: 404
Member Admin
 

@anshulkapoor Awesome! Glad it is working now. Feel free to create any new topics on the forum as you need or anything you want to share. Any cool projects you are working on with your AWS EC2 instance running Docker?

 
Posted : 22/01/2024 12:16 pm
(@anshulkapoor)
Posts: 8
Active Member
Topic starter
 

 

image

yes, we are trying to test the application on widows server before deplying to AWS ECS 

new issue

i have installed the dockerusing below command in powershell as administrator 

only user who are part of administrator group can ablw to run the docker command

.\install-docker-ce.ps1

but user who are added in remote desktop user are not able run docker commands and getting access denied error

And when remote desktop user run powershell as administrator they got an error @The app has been blocked by your administrator 

How we can give access to remote user to access powershell as administrator withour adding them in admin group 

i am attaching both the error for your reference 

.\install-docker-ce.ps1
image
 
Posted : 23/01/2024 9:25 pm
Brandon Lee
(@brandon-lee)
Posts: 404
Member Admin
 

@anshulkapoor I did some digging on this one. The issue relates to permissions to the Docker daemon. I was able to reproduce your error on a Windows Server 2022 host I have in my lab environment. 

2024 01 24 7 40 33

The solution involves just a few steps. First, you need to create the local Windows group docker-users. Then place the user you want to be able to run Docker in this group.

2024 01 24 7 41 25

Next, you need to create a daemon.json file in this path: C:\ProgramData\docker\config. The contents of the file will contain the following:

{
    "group": "docker-users"
}
2024 01 24 11 25 56

Save the file with those contents, and then restart your Docker Engine:

image

Now, you should be able to run Docker commands as an underprivileged user without the need to launch PowerShell as an admin:

2024 01 24 11 17 16

 

 
Posted : 24/01/2024 11:23 am
(@anshulkapoor)
Posts: 8
Active Member
Topic starter
 

 

image

i have verified these steps and found these already exist. Please find attached screenshot.

the inlt difference is these are AD user not the local user. Does that create any difference?

image
image
image
 
Posted : 24/01/2024 12:17 pm
Brandon Lee
(@brandon-lee)
Posts: 404
Member Admin
 

@anshulkapoor I will test on my side as well and see if it makes a difference with domain users.

 
Posted : 24/01/2024 12:22 pm
(@anshulkapoor)
Posts: 8
Active Member
Topic starter
 

Thanks the daemon.json config was like this before attached screen shot

i tried both ways host and adding tcp and only with group as well

 

both ways its not working

image

 

 
Posted : 24/01/2024 1:41 pm
Brandon Lee
(@brandon-lee)
Posts: 404
Member Admin
 

@anshulkapoor I have tested with a domain user who is a non-admin added to the local "docker-users" group, and it works for me.

2024 01 24 20 36 10
2024 01 24 20 34 56

Just curious, are you sure the Docker service was restarted after creating and making the changes to the daemon.json file?

 
Posted : 24/01/2024 8:38 pm
(@anshulkapoor)
Posts: 8
Active Member
Topic starter
 

Yes I restarted the service and reboot the server as well but not working 

  • when I added the domain user into adminstrator it is working fine.
 
Posted : 24/01/2024 9:37 pm
(@anshulkapoor)
Posts: 8
Active Member
Topic starter
 

Also prior to command line docker installation I was trying to install docker desktop in windows server 2022 was might be conflicting with docker user

 
Posted : 24/01/2024 9:51 pm
Page 1 / 2