Hi All I am trying to build a meltano docker imag...
# getting-started
t
Hi All I am trying to build a meltano docker image and add mysql-server to it The first steps of my docker file are below. I use the latest meltano docker image as my starting point
Copy code
# <http://registry.gitlab.com/meltano/meltano:latest|registry.gitlab.com/meltano/meltano:latest> is also available in GitLab Registry
ARG MELTANO_IMAGE=meltano/meltano:latest
FROM $MELTANO_IMAGE
RUN apt-get install -y mysql-server
I then run the command apt-get install -y mysql-server when I run my docker build command I get the below error during the creation of the container
Copy code
Step 3/9 : RUN apt-get install -y mysql-server
---> Running in f0166fd497f5
Reading package lists...
E: Unable to locate package mysql-server
Building dependency tree...
Reading state information...
The command '/bin/sh -c apt-get install -y mysql-server' returned a non-zero code: 100
I haven't been able to find a solution anywhere. My feeling is I need to reference the source of the mysql-server reposistory, but I don't know where this is or how to do it Is there anyone who knows what commands I need to run prior to the RUN apt-get install -y mysql-server? Thanks for any help Tim
v
This is really a docker / linux question. Simple answer I give to folks is make sure you know what commands you need to run before worrying about getting your Docker file right, to do that run bash in the base container. So hop into bash in the meltano container
Copy code
docker run run --entrypoint /bin/bash -it meltano/meltano:latest
Make sure your apt repos are up to date, check if
mysql-server
is even the right dependency for debian (Check the OS like this, or by following the build images in Docker)
Copy code
visch@DESKTOP-9BDPA9T:~$ podman run --entrypoint /bin/bash -it meltano/meltano:latest
root@7d76bcdd7e79:/project# cat /etc/*release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="<https://www.debian.org/>"
SUPPORT_URL="<https://www.debian.org/support>"
BUG_REPORT_URL="<https://bugs.debian.org/>"
t
Hi Derek Thank you for your reply I shall investigate your suggestions
Hi All Thought I'd update this now I have found a solution. Derek was correct in I was using the wrong package name for the apt-get. To install Mysql onto the latest meltano docker image I used
Copy code
ARG MELTANO_IMAGE=meltano/meltano:latest
FROM $MELTANO_IMAGE

# Install MySQL Server and other necessary packages
RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get install -y default-mysql-server && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*
Tim