logo
down
shadow

Add user to Docker container


Add user to Docker container

By : Iboro Udoh
Date : November 18 2020, 03:49 PM
Hope this helps The trick is to use useradd instead of its interactive wrapper adduser. I usually create users with:
code :
RUN useradd -ms /bin/bash newuser
USER newuser
WORKDIR /home/newuser
docker run -t -i image
newuser@131b7ad86360:~$


Share : facebook icon twitter icon
Permission denied error invoking Docker on Mac host from inside Docker Ubuntu container as non-root user

Permission denied error invoking Docker on Mac host from inside Docker Ubuntu container as non-root user


By : 胡屹然
Date : March 29 2020, 07:55 AM
Hope this helps I got this working, at least automated but currently only working on docker for Mac. Docker for Mac has a unique file permission model. Chowning /var/run/docker.sock to the jenkins user manually works, and it persists across container restarts and even image regeneration, but not past docker daemon restarts. Plus, you can't do the chown in the Dockerfile because docker.sock doesn't exist yet, and you can't do it in the entrypoint because that runs as jenkins.
So what I did was add jenkins to the "staff" group, because on my Mac, /var/run/docker.sock is symlinked down into /Users//Library/Containers/com.docker.docker/Data/‌​s60 and is uid and gid staff. This lets the jenkins user run docker commands on the host.
code :
FROM jenkins:latest

USER root

RUN \
    apt-get update && \
    apt-get install -y build-essential && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

COPY docker /usr/bin/docker

# To allow us to access /var/run/docker.sock on the Mac
RUN gpasswd -a jenkins staff

USER jenkins

ENTRYPOINT ["/bin/tini", "--", "/usr/local/bin/jenkins.sh"]
version: "3"
services:
  jenkins:
    build: ./cd_jenkins
    image: cd_jenkins:latest
    ports:
      - "8080:8080"
      - "5000:5000"
    volumes:
      - ./jenkins_home:/var/jenkins_home
      - /var/run/docker.sock:/var/run/docker.sock
Build container with php files unaccessible to user running the docker container?

Build container with php files unaccessible to user running the docker container?


By : Course Attendance
Date : March 29 2020, 07:55 AM
should help you out I understand that you intend somehow to distribute your application via Docker and don't want the user running the container to read the PHP code.
This problem is not something for Docker to solve, as the container file system is accessible by the user running the container.
Unable to see the user in peer docker container that got created in fabric-ca container

Unable to see the user in peer docker container that got created in fabric-ca container


By : WillieBoy
Date : March 29 2020, 07:55 AM
This might help you With the basic-network, when the cli container is created an environment variable is set: CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
You will need to reset this variable to direct to the folder for your new ID then you should be able to use the peer chaincode invoke command which will use the new credentials.
Can user privilege of docker container impact permission of host machine on mounted volume in docker-compose.yml?

Can user privilege of docker container impact permission of host machine on mounted volume in docker-compose.yml?


By : user3572194
Date : March 29 2020, 07:55 AM
I hope this helps . It doesn't matter with what user on host machine you start docker-compose up. When you mount /data/mysql into container, the mountpath inside the container will have same permissions and ownership as on the host machine. The process inside the container is not able write to this path.
How to access /var/run/docker.sock from inside a docker container as a non-root user? (MacOS Host)

How to access /var/run/docker.sock from inside a docker container as a non-root user? (MacOS Host)


By : Jason Yuryevich
Date : March 29 2020, 07:55 AM
wish help you to fix your issue It looks like the reason this is happening is pretty straight forward: UNIX permissions are not letting the jenkins user read /var/run/docker.sock. Really the easiest option is to just change the group assignment on /var/run/docker.sock from root to another group, and then add jenkins to that group:
Related Posts Related Posts :
  • syslog Log/ Event generator linux
  • Ping timeout issues
  • How make /var/www contents editable by IDE
  • Why ordinary user cannot use chgrp/chown
  • Execute a script on startup of SUSE reboot
  • Extracting debugging information from core files
  • linux command to connect to another server using hostname and port number
  • GLib.Settings.changed event not firing
  • What does it mean by code holding semaphore can be preempted
  • Does LD_LIBRARY_PATH really cause inconsistencies?
  • "lsof" shows a file as (deleted) but I can still see it in file system
  • Linux file deleted recovery
  • Exchange columns in bash
  • How to set max file size in Linux CeNTOS to server.log
  • Regular expressions: Search a word and append a new word at the end of the line
  • Compress a set of log files in a folder depending on number of files
  • unexpected behavior of linux malloc
  • relation between init and bash terminal process
  • Matlab VideoReader codec error?
  • How to catch the L3-cache hits and misses by perf tool in Linux
  • Executable Deleting Itself on linux
  • How to change the apache httpd port for serving files
  • Installing Patches in linux
  • Comparative analysis between libkvm on linux and NetBSD
  • How to join multiple txt files into based on column?
  • setting LINK variable in Makefile generated by qmake (5.0)
  • Automake - difficulty with installing version 'automake-1.14.1'
  • How to use Linux Network Namespaces for per processes routing?
  • How can I write a Gruntfile with different shell command behaviour for OS X vs. Linux?
  • Using at command in shell script for scheduling a command
  • Is there a method to figure out the audio channel layout in Linux?
  • Setting environment varilable for daemon / root process
  • string replacement in shell script
  • Add specific column to the end of a CSV file
  • Are there programmable automount/autofs hooks in linux/systemd?
  • Renaming files like 20141207_190822.jpg to "2014-12-07 19.08.22.jpg" in linux or MacOS X
  • undocumented kernel boot parameter?
  • using wget to mirror a website with path and subfolder that have the same name
  • Using awk to find data matching date range in text file
  • Installing xorg-x11-devel package in SLES 11 SP2
  • Setting result of find to variable, which has variables within it
  • Maximum/Minimum physical address - Linux kernel
  • Freepbx custom context outbound route
  • memcpy implementation in linux kernel
  • How to reverse a list of words in a shell string?
  • Concatenate and pass as parameter in bash
  • How to add a content in a file in linux without opening the file using vi or cat command
  • Which SVN subversion can I use on linux, Mac, Windows?
  • Work with ZIP archive at Bash
  • bash script not running as expected from cron vs. shell.
  • Compare one field, Remove duplicate if value of another field is greater
  • sudoers NOPASSWD: sudo: no tty present and no askpass program specified
  • How do I use pipes and variable substitution in a shell script (for toggling haproxy active server)?
  • Linux/Unix Find Command
  • Not able to copy data in hdfs with hdfs dfs commands
  • Linux : Remove/Delete .txt files ending with exactly five digits
  • ARM assembly "retne" instruction
  • Migrate from LXC to LXD
  • sbt on linux not accepting -jvm-debug 5005
  • Supervisord events only sent to one eventlistener in pool
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org