"Encountered an issue while attempting to run the docker-compose script on AWS

Launching my application with sudo docker-compose up works fine, but when I try docker-compose up, it throws the following error:

$ docker-compose up
Traceback (most recent call last):
  File "urllib3/connectionpool.py", line 670, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1255, in request
  File "http/client.py", line 1301, in _send_request
  File "http/client.py", line 1250, in endheaders
  File "http/client.py", line 1010, in _send_output
  File "http/client.py", line 950, in send
  File "docker/transport/unixconn.py", line 43, in connect
PermissionError: [Errno 13] Permission denied

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requests/adapters.py", line 439, in send
  File "urllib3/connectionpool.py", line 726, in urlopen
  File "urllib3/util/retry.py", line 410, in increment
  File "urllib3/packages/six.py", line 734, in reraise
  File "urllib3/connectionpool.py", line 670, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1255, in request
  File "http/client.py", line 1301, in _send_request
  File "http/client.py", line 1250, in endheaders
  File "http/client.py", line 1010, in _send_output
  File "http/client.py", line 950, in send
  File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', PermissionError(13, 'Permission denied'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker/api/client.py", line 214, in _retrieve_server_version
  ...

========================
[48420] Failed to execute script docker-compose

This section contains my Docker file information:

FROM golang:alpine AS builder

ENV GO111MODULE=on
RUN mkdir /app
ADD . /app/
WORKDIR /app
COPY ./data.go .
COPY ./handlers.go .
COPY ./main.go .
COPY ./static /static
COPY ./ssl /ssl
COPY ./views /views
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build $(ls -1 *.go)
RUN useradd -u ubuntu
USER ubuntu
EXPOSE 3000
CMD ["go", "run", "."]

Answer №1

If you are a non-root user, it is necessary to include the user in the docker group.

1- Establish a docker group if it does not already exist:

sudo groupadd docker

2- Insert your user into the docker group:

sudo usermod -aG docker [non-root user]

3- Log out and log back in to update group membership.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Issue with logging handler in Boto3 library

When attempting to import the boto3 library, I keep encountering an error. Even after installing both version 1.4.1 and downgrading to 1.3.1, the error persists as shown below: Traceback (most recent call last): File "storage.py", line 1, in <modul ...

An error is triggered, resulting in a TypeError being raised

I have a question regarding try-except statements that is different from the other questions mentioned. I am not in need of a finally statement... Consider the following code snippet: try: #dosomething except TypeError: #dosomething -> THIS RE ...

Unable to install npm package in a directory that is mounted on another location

After brainstorming, my concept involves utilizing a docker container to build JS and CSS assets separately from the main application. I have the code stored on the host machine and am attempting to mount the directory containing my code as a volume to the ...

Explore various profiles on Flask-Strompath

I am working with a flask.ext.stormpath instance and my goal is to retrieve all users based on the created_at filter. I have attempted various methods without success. flask.ext.stormpath.accounts Apologies for the brief question, but for clarification, ...

The error message "my_init: symbol not found" is being displayed in the Alpine Linux Apache2 environment when trying to load the apr_dbd

My PHP website is being built using Docker, with the base image as phpswoole/swoole:4.8-php7.3-alpine (alpine 3.13). Below are the dockerfile commands for installing apache2 and dependencies. apk add --no-cache apache2 php7-apache2 apr-util-dbd_mysql apac ...

Converting Zerodha data into a Pandas DataFrame

Currently, I am working on a project that involves extracting raw data from Zerodha into pandas using Python along with Selenium. However, I am encountering an issue while trying to click on the toggle button that displays the raw data. Please refer to the ...

Are there specific methods for selecting HTML elements using Selenium and Python?

I am currently working on a web crawler application using selenium and Python, but I have run into a roadblock. see attached image for reference In the image, I am able to select text with an underline. However, what I actually need is to be able to extr ...

Can an XPath be affected by changes in its surrounding content?

If the content within the XPath is altered, does the XPath itself change? For example, if the website changes the text in the XPath element from 'supports' to 'support', will the XPath also change or remain unaffected by the modificati ...

Navigating around Security Certificate page on Microsoft Edge using Selenium WebDriver

Is there a way to bypass the Security Certificate page for Microsoft Edge when using Selenium Webdriver with Python? https://i.stack.imgur.com/StSpB.jpg I've tried solutions that have worked for Internet Explorer in the past, following suggestions f ...

best practices for dealing with blank lines in logging request headers within a flask application

Is there a way to log request headers in the logfile without getting all those blank lines in between? I've tried using: logging.debug("Headers:{0}".format(request.headers)) but the output is full of empty lines. I noticed there are '/r/n' ...

Python element fuzziness verification

I am working with a Python 2.7 set object that contains the names of data categories. My goal is to implement fuzzy element checking to determine if part of a user-provided input matches an element in the set. Here's an example scenario: given the fo ...

Error encountered in Windows/Python - WindowsError: [Error 3] Unable to locate the specified path within the system

Hello! I am a beginner in Python and I could really use some assistance. My goal is to run a file on the Windows 10 operating system using Python 2.7. import os import re import codecs import numpy as np import theano # More code here... Every time I tr ...

Troubleshooting problems with AWS Elastic Beanstalk deployment

I am encountering an issue while attempting to deploy my Node.js app to Elastic Beanstalk. The app is functioning correctly locally, but when I try to deploy it, I receive the following error: Failed to run npm install. Check snapshot logs for more detail ...

Update Python variables using a button in Kivy framework

I am currently developing an application that needs to check the value of a variable in its Python code and have a button that can change this variable's value. It is crucial for the application to also save this information in a text file, ensuring t ...

Tips on storing data in Excel using pandas?

My script performs the following actions: 1. Accesses the website 2. Gathers links and stores them in a dictionary 3. Navigates through the saved links to extract elements, which are then stored in another dictionary 4. Finally, it saves the extracted ...

error message on a MacBook using Python: "File or directory not found: [Errno 2]"

I encountered an issue with [Errno 2] stating there is no such file or directory. This problem is unfamiliar to me in Windows Visual Studio. Below, you can find the code where the problem arises: from selenium import webdriver from selenium.webdriver.comm ...

Utilize Django to resize images using the Python Imaging Library

I have been working on my app where I compress uploaded images in the save method. Now, I also want to resize the images if they are too large. After experimenting with PIL in a test environment, I was able to come up with this code that accomplishes the t ...

Scraping does not include multiple values for the same tag

My search for "Number of Rooms" and "Room" is returning no values. Although I expect some data, nothing is being displayed. Can someone guide me on how to troubleshoot this? I am unsure of what to look for as there are no errors. Initially, I thought all ...

Is it possible to automate the process of clicking the "next" or "previous" button on a webpage after a video has finished playing?

Is it possible to automate clicking the "next" or "previous" button on a specific website? The buttons are not labeled as such but instead show the cartoon name and episode number. For example, increasing episode numbers indicate the "next" episode while d ...

Creating a series of N sequential equidistant colors that transition from dark to light can be achieved programmatically through a

I am looking to generate a gradient of N unique colors that transition from a dark shade to a light shade, evenly spaced in terms of visual appearance. Similar to the concept discussed in this post but tailored for Python rather than R (limited to using s ...