Comments (9)
I managed the issue changing the HOST_GID in the bootstrap script to store my system's Docker group identifier. Now I can to use the socket /var/run/docker.sock inside the container and run deploy script from my local environment.
from lamby.
I got the GID using the command getent group docker | cut -d: -f3
The build command looks like this:
docker-compose build \
--build-arg HOST_UID="${HOST_UID:=$(id -u)}" \
--build-arg HOST_GID="${HOST_GID:=$(getent group docker | cut -d: -f3)}"
Currently the image public.ecr.aws/sam/build-ruby2.7:1.27
contains a group named "input" that matches the "docker" group on my system.
from lamby.
I recently refactored the Lamby Cookiecutter to simplify a great many things. Should help, especially the devcontainer stuff. Review here:
Let me know if you have any questions. Docs coming soon on the new site.
from lamby.
I have the same issue
and my brainless solution was to change the user
in docker-compose.yml
from lamby
to root
The short version: the containers user doesn't have permission to access /var/run/docker.sock
.
Long version:
I have a default Ubuntu install. User and group share the same names and ids (uid
and gid
). e.g. x:x
(1000:1000
)
I followed the Post-installation steps for Linux and I created a new group called docker
and added my user into it.
The Lamby docker image build uses my user and group IDs to create its own user/group. e.g. lamby:lamby
When docker-compose mounts /var/run/docker.sock
it uses the docker
group ID that the lamby
container user doesn't belong to.
It causes the permission fault / Error: Building image for RailsLambda requires Docker. is Docker running?
from lamby.
This is not expected. The cookiecutter is written to work on Linux as far as I can tell... mostly because we encourage GitHub Actions which is a Linux host. I just did a test with the latest and it all worked. See here for details.
https://github.com/metaskills/lambytest42/actions/runs/1020165380
Since this issue was created I did do a small change to the cookiecutter. Basically leveraging the SAM docker tag on the development/test/build image. This should not make a difference, but I did want to share. https://github.com/metaskills/lambytest42/actions/runs/1020165380
Can you create a test project from the latest cookiecutter and verify it works or does not? If it does not, what could be happening that deploy works for GitHub Ubuntu latest Linux vs others?
from lamby.
Is it possible this issue is fixed via this comment? #100 (comment)
from lamby.
I also had success with changing the HOST_GID and HOST_UID. I changed the bootstrap script to also include to check for "Linux" in the if statement that sets HOST_GID and HOST_UID to 0.
if [ "$(uname -s)" = "Darwin" ] || [ "$(uname -s)" = "Linux" ]; then
HOST_UID="0"
HOST_GID="0"
fi
@metaskills This makes me wonder if we should change this indefinite without the if statement. Darwin is the MacOS I'm running it is working, and could this work for all other OS? Will this break in Github's Linux or Windows?
from lamby.
@Digoss Could you share your bootstrap script file? I would like to know how are you setting your system's Docker group identifier
from lamby.
Getting kind of hard to write good cross compatible Docker code. I've been playing a lot with GitHub Codespaces and think I may have found an easier pattern for the dev container stuff we have been pushing. Some details here:
from lamby.
Related Issues (20)
- Issue while runing ./bin/deploy from the RAils on Lambda in 5min guide HOT 14
- Outline Arm64 Steps HOT 3
- qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2 for M1 HOT 6
- libmysqlclient.so.18: cannot open shared object file: No such file or directory HOT 3
- Documentation on how to Add Middleware (V4) HOT 2
- Document what exact AWS-managed policies are needed for the access key HOT 5
- SIGTERM SignalException: Init error when loading handler HOT 5
- Codespaces Share HOT 1
- Don't set percent encoded queries into Rack Environment's `QUERY_STRING` HOT 1
- cannot load such file -- config/environment HOT 3
- Too slow even with provisioned provisioned concurrency HOT 6
- Opinionated OpenID Connect HOT 2
- Postgres ? HOT 2
- Ensure VPC Lattice Events Work HOT 2
- Use Image Devcontainer Step in GitHub Actions
- Unable to run my app or the cookiecutter... getting error `materialize': Could not find HOT 14
- Performance vs traditional server HOT 4
- uninitialized constant Rack::RACK_MULTITHREAD HOT 5
- Local Development
- Access to filesystem - Errno::EACCES (Permission denied
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lamby.