cachewerk / linux-repos

Relay packages and repositories for Debian, Ubuntu and CentOS.
https://relay.so
MIT License
12 stars 2 forks source link

Docker Ubuntu: Getting Access Denied On Repo #9

Closed dylandownhill closed 1 year ago

dylandownhill commented 1 year ago

I am following the instructions https://github.com/cachewerk/relay/blob/main/docker/ubuntu22-apt.Dockerfile

When I run a "docker build .", amongst the messages is:

Err:4 https://cachewerk.s3.amazonaws.com/repos/deb kinetic InRelease
  403  Forbidden [IP: <my EC2 instance IP address> 443]
Ign:5 https://ppa.launchpadcontent.net/ondrej/php/ubuntu kinetic InRelease
Get:6 http://archive.ubuntu.com/ubuntu kinetic-backports InRelease [99.9 kB]
Err:7 https://ppa.launchpadcontent.net/ondrej/php/ubuntu kinetic Release
  404  Not Found [IP: 185.125.190.52 443]
Reading package lists...
E: Failed to fetch https://cachewerk.s3.amazonaws.com/repos/deb/dists/kinetic/InRelease  403  Forbidden [IP: <my EC2 instance IP address> 443]
E: The repository 'https://cachewerk.s3.amazonaws.com/repos/deb kinetic InRelease' is not signed.
E: The repository 'https://ppa.launchpadcontent.net/ondrej/php/ubuntu kinetic Release' does not have a Release file.

I also tried accessing through my browser at https://cachewerk.s3.amazonaws.com/repos/deb and got:

<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>JD7WX4H91805AS7R</RequestId>
<HostId>oHfc1e31vIL6fm1R0pn+ao/fJP3LrFd0HKqOvDyzXCLaEJ19xcCZHn6r1rqB0UAk0IwlI8L5iOo=</HostId>
</Error>

My docker file:

################################################################################
# Base image
################################################################################

FROM ubuntu:22.10

################################################################################
# Build instructions
################################################################################

# If you change PHP version make sure conf/supervisord.conf is updated too
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=America/Los_Angeles

# RUN apt-get install -y tzdata
# set your timezone
RUN ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime

# Install packages
RUN apt-get update && apt-get install -my \
  supervisor \
  curl \
  wget \
  nginx \
  cron \
  vim \
  ucommon-utils \
  php8.1 \
  php8.1-fpm \
  ca-certificates \
  apt-transport-https \
  software-properties-common

# Add Relay repository
RUN add-apt-repository ppa:ondrej/php
RUN curl -s "https://cachewerk.s3.amazonaws.com/repos/key.gpg" | apt-key add -
RUN add-apt-repository "deb https://cachewerk.s3.amazonaws.com/repos/deb $(lsb_release -cs) main"
RUN apt update

# The PHP extensions needs to be after PHP and PHP-FPM to ensure they're loaded properly
RUN apt-get install -my \
  php8.1-curl \
  php8.1-gd \
  php8.1-intl \
  php8.1-mbstring \
  php8.1-mysql \
  php8.1-opcache \
  php8.1-soap \
  php8.1-xml \
  php-redis \
  php8.1-relay

# Remove default nginx configs.
RUN rm -f /etc/nginx/conf.d/*

# Ensure that PHP FPM is run as root.
# RUN sed -i "s/user = www-data/user = root/" /etc/php/8.1/fpm/pool.d/www.conf
# RUN sed -i "s/group = www-data/group = root/" /etc/php/8.1/fpm/pool.d/www.conf
# RUN sed -i "s@listen = /run/php/php8.1-fpm.sock@listen = 128.1.0.1:9000@" /etc/php/8.1/fpm/pool.d/www.conf
RUN sed -i "s/pm.max_children = 5/pm.max_children = 100/" /etc/php/8.1/fpm/pool.d/www.conf
RUN sed -i "s/pm.start_servers = 2/pm.start_servers = 15/" /etc/php/8.1/fpm/pool.d/www.conf
RUN sed -i "s/pm.min_spare_servers = 1/pm.min_spare_servers = 10/" /etc/php/8.1/fpm/pool.d/www.conf
RUN sed -i "s/pm.max_spare_servers = 3/pm.max_spare_servers = 20/" /etc/php/8.1/fpm/pool.d/www.conf
RUN sed -i "s/;pm.max_requests = 500/pm.max_requests = 500/" /etc/php/8.1/fpm/pool.d/www.conf

# Pass all docker environment
RUN sed -i '/^;clear_env = no/s/^;//' /etc/php/8.1/fpm/pool.d/www.conf

# Get access to FPM-ping page /ping
RUN sed -i '/^;ping\.path/s/^;//' /etc/php/8.1/fpm/pool.d/www.conf

# Get access to FPM_Status page /status
RUN sed -i '/^;pm\.status_path/s/^;//' /etc/php/8.1/fpm/pool.d/www.conf

# Prevent PHP Warning: 'xdebug' already loaded.
# XDebug loaded with the core
# RUN sed -i '/.*xdebug.so$/s/^/;/' /etc/php5/mods-available/xdebug.ini

# Add configuration files
RUN mkdir -p /etc/nginx/; mkdir -p /run/php; mkdir -p /etc/nginx/global; rm -f /etc/nginx/sites-enabled/*
COPY ./conf/nginx.conf /etc/nginx/
COPY ./conf/global/* /etc/nginx/global/
COPY ./conf/php.ini /etc/php/8.1/fpm/conf.d/40-custom.ini
COPY ./conf/supervisord.conf /etc/supervisor/conf.d/
COPY ./sites/* /etc/nginx/sites-enabled/

#Manually add back in the blank line and the final '#' - if we use the windows file for this it adds a "^M" newline
COPY ./conf/crontab /tmp/crontab
RUN cat /tmp/crontab >> /etc/crontab ; echo "" >> /etc/crontab; echo "#" >> /etc/crontab 

################################################################################
#
# Running this through docker-compose? make sure you update docker-compose.yml too.
#
################################################################################

# forward request and error logs to docker log collector
RUN ln -sf /dev/stdout /var/log/nginx/access.log
RUN ln -sf /dev/stderr /var/log/nginx/error.log

################################################################################
# Volumes
################################################################################

VOLUME ["/var/www", "/etc/nginx/conf.d"  ]

################################################################################
# Ports
################################################################################

EXPOSE 80 81 8081 8082 8083 8084 8085 8086 8087 8088 8089 443 6379

################################################################################
# Entrypoint
################################################################################

ENTRYPOINT ["/usr/bin/supervisord"]
tillkruss commented 1 year ago

We're not building kinetic packages. It's easy tho. What are the new releases we're missing?

See:

https://github.com/cachewerk/linux-repos/blob/2f6548ecaa3eb59ff5070a42422474323dddbd34/build/deb-repo.sh#L5-L6

https://github.com/cachewerk/linux-repos/blob/a32c1526684cee4d4d230fc455fd388db51ff9a1/deb/sources.list#L1-L7

dylandownhill commented 1 year ago

I am on kinetic. I checked the Ubuntu website and they list: jammy, focal, bionic, xenial, trusty, and kinetic, of which just kinetic and trusty are missing in the list above. https://releases.ubuntu.com/

Should I drop back to previous Ubuntu version?

tillkruss commented 1 year ago

Or change kinetic to jammy in the deb file. That may work.

dylandownhill commented 1 year ago

As an update: I changed to ubuntu 22.04 and it worked. Thank you for the help

tillkruss commented 1 year ago

I haven't tested this, but theoretically if you're on 22.10 (kinetic), then the 22.04 (jammy) should work:

add-apt-repository "deb https://cachewerk.s3.amazonaws.com/repos/deb jammy main"