Welcome to thatlinuxbox.com Thursday, November 21 2024 @ 06:36 AM UTC

Access Docker After Install Without Logout or Reboot

View Printable Version
  • Tuesday, March 24 2020 @ 06:48 PM UTC
  • Contributed by:
  • Views: 4,266
Linux, Open Source, and Tech Stuff

Share
  • Google Plus
  • Facebook
  • Twitter
  • Reddit
  • LinkedIn
  • Digg

By default, after installing docker on Ubuntu, normal user accounts cannot connect to the docker daemon.

$ sudo apt install docker.io

$ docker ps

Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock

 

After adding one's user account to the "docker" group, a full logout and login is typically needed for the user account to receive the new group membership. And in fact, on Ubuntu running the default desktop environment, one may need to actually reboot or run an extra command such as:

$ loginctl terminate-user $USERNAME

because systemd seems to preserve a user context even after logout.

Starting a new bash login shell inside an existing terminal is definitely insufficient:

$ bash --login -i

Terminating a desktop session can be fairly inconvenient, depending on the amount of Work In Progress and document editors and browser tabs, etc.

 

On Ubuntu 18.04, here are steps to allow a normal user account to immediately access docker without having to log out first:

$ groups  # note that "docker" will not be in list of groups

$ sudo gpasswd -a $USERNAME docker   # add your specific username to the "docker" group

 

$ sudo grpck   # verify that your group file has no syntax errors, and only the expected differences exist
[sudo] password for dan: 
'dan' is a member of the 'docker' group in /etc/group but not in /etc/gshadow

$ sudo grpconv    # syncs group and gshadow aka the magic command that prevents "newgrp" from generating the error: 'failed to crypt password with previous salt'

$ newgrp docker  # log in to new group (starts a subshell with the new group membership attached, environment preserved)

$ groups  # note that "docker" will now appear in list of groups for the user

$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED
         STATUS              PORTS               NAMES

 

$ docker run docker/whalesay cowsay "No Logout Needed!"
 ___________________ 
< No Logout Needed! >
 ------------------- 
    \
     \
      \     
                    ##        .            
              ## ## ##       ==            
           ## ## ## ##      ===            
       /""""""""""""""""___/ ===        
  ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ /  ===- ~~~   
       \______ o          __/            
        \    \        __/             
          \____\______/   

 

Thanks to the following articles which provided reference for this blog post:

https://askubuntu.com/questions/477551/how-can-i-use-docker-without-sudo

https://www.geeksforgeeks.org/grpconv-command-in-linux-with-examples/

https://askubuntu.com/questions/1045993/after-adding-a-group-logoutlogin-is-not-enough-in-18-04

Thermal Issues on Dell Latitude with Microsoft Teams for Linux

View Printable Version
  • Friday, March 20 2020 @ 06:26 PM UTC
  • Contributed by:
  • Views: 3,441
Linux, Open Source, and Tech Stuff

Share
  • Google Plus
  • Facebook
  • Twitter
  • Reddit
  • LinkedIn
  • Digg

With work from home orders due to COVID-19, I am now working remotely fulltime.

My company is relying on Microsoft Teams for chat and video conferencing. Thankfully, Microsoft released a native Linux client.  Not really, it appears to be an electron app. But at least it doesn't need to run in a browser tab somewhere.  And it actually works... audio, video, and screen sharing. And after using a variety of video conferencing solutions over the years, I can say that video and audio quality of Teams is quite good.  Unfortunately, as of Microsoft Teams Version 1.3.00.958 (64-bit), the app is a CPU hog and causes my Ubuntu laptop to heat up. When the laptop heats up, the fan winds up like a small jet engine.  This is especially noticeable in a quiet home office environment.

I spent a lot of time with i8kutils and cpufrequtils to no avail. On Linux, the Dell Latitude 5501 seems to have only three fan speeds: off, low, and high. There is no medium speed. It is possible to tweak the temperature at which those fan transitions happen, but it is not possible adjust the fan RPMs.  On "low", the temperature will just continue to rise while Teams is running and eventually the fan has to kick into high (or the laptop overheat and crash).

The most significant change I was able to make to resolve the heat issue was to turn off TurboBoost. Whereas my temps were shooting up to over 90 degrees C if I tried to run the fan on "low", with TurboBoost disabled the temperature rarely goes about 50 degrees C. I disabled both Hyperthreading and TurboBoost in the system BIOS. This is disappointing to say the least, but this laptop still has 6 cores running at 1.4 GHz, which has been fine for all of the types of work I have been doing.

After disabling TurboBoost, the cpufreq-info tool shows:

 

GATE River Run 15k 2020 - Race Report

View Printable Version
  • Saturday, March 07 2020 @ 06:58 PM UTC
  • Contributed by:
  • Views: 1,512
Running and Fitness

Share
  • Google Plus
  • Facebook
  • Twitter
  • Reddit
  • LinkedIn
  • Digg

For the 2020 Gate River Run, the national 15k championship race, I traveled to Jacksonville with a friend the night before the race and we stayed at the race hotel. We were able to pick up our race packets and enjoy the expo without feeling the rush of race day morning. We had dinner and a beer at Intuition Ale Works on Friday night which was happily not crowded at all. The beer was excellent. I highly recommend Intuition if you are in the area.



The Hilton is almost exactly 1 mile away from the starting line... a perfect distance for warmup before the race... which we needed because it was cold and windy! This was my first Gate River Run that wasn't warm and humid and it was fantastic. With temperatures in the 40s at the start and the sun rising in the sky, no hat or gloves were needed and it was perfect weather for racing.

I did a good job of sticking to my race plan and not going out too hard, targeting 6:30 per mile based on my fitness level. In the last set of neighborhoods I had a tiny rough patch and fell off the pace a little bit before I was able to muster and charge towards the bridge.

The wind was ferocious throughout the race and if the Hart Bridge wasn't challenging enough, the strong headwind was the final battle. Coming over the top of the bridge I saw I needed to run sub-6 minute mile to go under an hour. I tried and tried but it took a long time to get moving again. The wind kept slowing me down even on the downhill.









I finished 153rd male overall, 10th in my age group, with a finish time of 1:00:10, averaging 6:27 per mile. This was my second-fastest River Run. I feel really good about this performance and I am looking forward to big gains next year.




Gate River Run 2020 was held on March 7. Results are available:
https://my.raceresult.com/148877/results?lang=en

PDF full results:
https://my1.raceresult.com/148877/RRP...mp;lang=en


T-shirt, medal, pint glass, top 10 percent finisher hat, and race shoes (Topo ST-2):


Five Points of Life Half Marathon - 2020

View Printable Version
  • Sunday, February 16 2020 @ 10:27 PM UTC
  • Contributed by:
  • Views: 1,589
Running and Fitness

Share
  • Google Plus
  • Facebook
  • Twitter
  • Reddit
  • LinkedIn
  • Digg

This year the race start and finish venue was downtown Gainesville, FL. On Sunday morning parking was no problem, with many city lots reserved for racers to park. The weather was nice and course was great.


Photo by Enoch Nadler


Photo credit: LifeSouth Community Foundation


I enjoyed my free beer in the biergarten which was placed right by the finish, so we could watch the rest of the finishers while we hung out and enjoyed the day. They race provided some delicious free food that included burritos and donuts from local food trucks.


Photo credit: LifeSouth Community Foundation


I ran as well as I could have hoped, finishing in 1:27:59 (avg. under 6:45 per mile). I won my age group and brought home a bag of locally roasted Sweetwater coffee as the prize.







The Five Points of Life Half Marathon took place on February 16, 2020. Race results are available at:

https://drcsports.com/race-results/169

Newnan's Lake 15k Race Report 2020

View Printable Version
  • Wednesday, January 29 2020 @ 01:08 AM UTC
  • Contributed by:
  • Views: 1,307
Running and Fitness

Share
  • Google Plus
  • Facebook
  • Twitter
  • Reddit
  • LinkedIn
  • Digg

2020 provided another perfect race day for the Lloyd Clarke Sports Newnan's Lake 15k. Weather was sunny with temps in the 40s at the start.

I didn't find any photos of me racing, but I did take a photo of the lake before the start.



I am really happy with my race. I finished about a minute faster than my stretch goal, with a time of 1:02:01 (or 6:40 per mile).

The shirt this year was great -- tech fabric with long-sleeves:



Life isn't getting any easier in the Masters division around here. Four guys over 40 were ahead of me.

The event was held on January 25, 2020. Race results are posted here:

https://results.rmraces.live/Start-2-...5k/results


New Job - DevOps Engineer

View Printable Version
  • Sunday, January 19 2020 @ 01:19 PM UTC
  • Contributed by:
  • Views: 1,215
Fun Stuff @ Work

Share
  • Google Plus
  • Facebook
  • Twitter
  • Reddit
  • LinkedIn
  • Digg

In December I started my new job at Infinite Energy, Inc. as a DevOps Engineer. What attracted me to this job the most was the Culture of the company and the high levels of awareness of the managers that I met.

On my first day I received a laptop and my team suggested that I install Linux.



It is nice to be using Linux again full-time.

We are using GitOps practices with Flux and Kubernetes.

Nothing else much to report yet. I had some time to fiddle with my shell environment. zsh seems to be the popular shell these days so I played with it a little bit but instead decided to stick with Bash. I found a project similar to oh-my-zsh called oh-my-bash which I am using to customize my shell prompt.



User Functions

Login

Connect

thatlinuxbox.com is the home of Dan Stoner's Personal Blog, Photos, and More (opinions, rants, techno-babble, and possibly a few useful tidbits of knowledge).

Questions or Comments about this site? Contact danstoner _ at _ gmail.com.

RSS Feed for this blog

Other places to find me on the web:

Twitter

LinkedIn

GitHub

Support This Site

If you like something that you find on this site, please consider making a purchase through one of the links below or sending me an item from my Amazon Wish List.


The Clymb


Awesome VPS hosting by Linode.com