public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH server-a001 v1 0/2] Install net-tools and MySQL server
@ 2022-04-17 12:51 Ammar Faizi
  2022-04-17 12:51 ` [PATCH server-a001 v1 1/2] Install net-tools Ammar Faizi
  2022-04-17 12:51 ` [PATCH server-a001 v1 2/2] Install MySQL server Ammar Faizi
  0 siblings, 2 replies; 13+ messages in thread
From: Ammar Faizi @ 2022-04-17 12:51 UTC (permalink / raw)
  To: GNU/Weeb Mailing List
  Cc: Ammar Faizi, Hazmi Alfarizqi, Hazmi Alfarizqi,
	Alviro Iskandar Setiawan

Hi,

Two patches this time. Install net-tools and MySQL server.
Not much to tell here...

## Patch 1 (Install net-tools)
Install networking tools like netstat and ifconfig. We will often use
them to inspect and troubleshoot network problem.

## Patch 2 (Install MySQL)
We will need a MySQL server as the database for: postfix, dovecot and
mail accounts. This will give us mysql-server v8.

Go review!

Cc: Hazmi Alfarizqi <[email protected]>
Cc: Hazmi Alfarizqi <[email protected]>
Cc: Alviro Iskandar Setiawan <[email protected]>
Signed-off-by: Ammar Faizi <[email protected]>
---

Ammar Faizi (2):
  Install net-tools
  Install MySQL server

 Dockerfile           | 4 ++--
 docker-entrypoint.sh | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)


base-commit: 805621a61ed6aaef8ab9ff4dfb667ff1faa486d5
-- 
Ammar Faizi


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH server-a001 v1 1/2] Install net-tools
  2022-04-17 12:51 [PATCH server-a001 v1 0/2] Install net-tools and MySQL server Ammar Faizi
@ 2022-04-17 12:51 ` Ammar Faizi
  2022-04-17 13:13   ` Alviro Iskandar Setiawan
  2022-04-18 17:00   ` Hazmi Alfarizqi
  2022-04-17 12:51 ` [PATCH server-a001 v1 2/2] Install MySQL server Ammar Faizi
  1 sibling, 2 replies; 13+ messages in thread
From: Ammar Faizi @ 2022-04-17 12:51 UTC (permalink / raw)
  To: GNU/Weeb Mailing List
  Cc: Ammar Faizi, Hazmi Alfarizqi, Hazmi Alfarizqi,
	Alviro Iskandar Setiawan

Install networking tools like netstat and ifconfig. We will often use
them to inspect and troubleshoot network problem.

Signed-off-by: Ammar Faizi <[email protected]>
---
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index 5e59701..7d78c86 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -12,7 +12,7 @@ ARG DEBIAN_FRONTEND=noninteractive
 RUN yes | unminimize
 
 # Install base packages
-RUN apt-get update && apt-get -y --no-install-recommends install ca-certificates gnupg htop ncurses-term vim software-properties-common sudo wget
+RUN apt-get update && apt-get -y --no-install-recommends install ca-certificates gnupg htop ncurses-term vim software-properties-common sudo wget net-tools
 
 # Change root password, and create main user
 RUN echo "root:${rootPassword}" | chpasswd \
-- 
Ammar Faizi


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH server-a001 v1 2/2] Install MySQL server
  2022-04-17 12:51 [PATCH server-a001 v1 0/2] Install net-tools and MySQL server Ammar Faizi
  2022-04-17 12:51 ` [PATCH server-a001 v1 1/2] Install net-tools Ammar Faizi
@ 2022-04-17 12:51 ` Ammar Faizi
  2022-04-17 13:06   ` Alviro Iskandar Setiawan
  1 sibling, 1 reply; 13+ messages in thread
From: Ammar Faizi @ 2022-04-17 12:51 UTC (permalink / raw)
  To: GNU/Weeb Mailing List
  Cc: Ammar Faizi, Hazmi Alfarizqi, Hazmi Alfarizqi,
	Alviro Iskandar Setiawan

We will need a MySQL server as the database for: postfix, dovecot and
mail accounts. This will give us mysql-server v8.

Signed-off-by: Ammar Faizi <[email protected]>
---
 Dockerfile           | 2 +-
 docker-entrypoint.sh | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index 7d78c86..883d260 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -27,7 +27,7 @@ COPY apt-sources/* /etc/apt/sources.list.d
 # Install server components
 RUN apt-key adv --fetch-keys https://nginx.org/keys/nginx_signing.key \
     && apt-get update \
-    && apt-get -y --no-install-recommends install openssh-server nginx
+    && apt-get -y --no-install-recommends install openssh-server nginx mysql-server
 
 # Mark port 48589/tcp is to be exposed
 EXPOSE 48589/tcp
diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
index 1d8114d..ba9026c 100755
--- a/docker-entrypoint.sh
+++ b/docker-entrypoint.sh
@@ -2,5 +2,6 @@
 
 service ssh start
 service nginx start
+service mysql start
 
 exec "$@"
-- 
Ammar Faizi


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH server-a001 v1 2/2] Install MySQL server
  2022-04-17 12:51 ` [PATCH server-a001 v1 2/2] Install MySQL server Ammar Faizi
@ 2022-04-17 13:06   ` Alviro Iskandar Setiawan
  2022-04-17 13:26     ` Ammar Faizi
  2022-04-17 14:57     ` Ammar Faizi
  0 siblings, 2 replies; 13+ messages in thread
From: Alviro Iskandar Setiawan @ 2022-04-17 13:06 UTC (permalink / raw)
  To: Ammar Faizi
  Cc: GNU/Weeb Mailing List, Hazmi Alfarizqi, Hazmi Alfarizqi,
	Alviro Iskandar Setiawan

On Sun, Apr 17, 2022 at 7:51 PM Ammar Faizi <[email protected]> wrote:
>
> We will need a MySQL server as the database for: postfix, dovecot and
> mail accounts. This will give us mysql-server v8.
>
> Signed-off-by: Ammar Faizi <[email protected]>
> ---

This patch is lacking in MySQL preparation, like setting up user/pass,
port to be exposed, database, and whatnot. Instead of deferring many
things for next, why not include it in this patch?

Also, it needs persistent storage, container is temporary, but our
database is permanent???

-- Viro

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH server-a001 v1 1/2] Install net-tools
  2022-04-17 12:51 ` [PATCH server-a001 v1 1/2] Install net-tools Ammar Faizi
@ 2022-04-17 13:13   ` Alviro Iskandar Setiawan
  2022-04-18 17:00   ` Hazmi Alfarizqi
  1 sibling, 0 replies; 13+ messages in thread
From: Alviro Iskandar Setiawan @ 2022-04-17 13:13 UTC (permalink / raw)
  To: Ammar Faizi
  Cc: GNU/Weeb Mailing List, Hazmi Alfarizqi, Hazmi Alfarizqi,
	Alviro Iskandar Setiawan

On Sun, Apr 17, 2022 at 7:51 PM Ammar Faizi <[email protected]> wrote:
> Install networking tools like netstat and ifconfig. We will often use
> them to inspect and troubleshoot network problem.
>
> Signed-off-by: Ammar Faizi <[email protected]>
> ---

LGTM, netstat and ifconfig are useful.

Reviewed-by: Alviro Iskandar Setiawan <[email protected]>

tq

-- Viro

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH server-a001 v1 2/2] Install MySQL server
  2022-04-17 13:06   ` Alviro Iskandar Setiawan
@ 2022-04-17 13:26     ` Ammar Faizi
  2022-04-17 13:34       ` Alviro Iskandar Setiawan
  2022-04-17 14:57     ` Ammar Faizi
  1 sibling, 1 reply; 13+ messages in thread
From: Ammar Faizi @ 2022-04-17 13:26 UTC (permalink / raw)
  To: Alviro Iskandar Setiawan
  Cc: GNU/Weeb Mailing List, Hazmi Alfarizqi, Hazmi Alfarizqi,
	Alviro Iskandar Setiawan

On 4/17/22 8:06 PM, Alviro Iskandar Setiawan wrote:
> On Sun, Apr 17, 2022 at 7:51 PM Ammar Faizi <[email protected]> wrote:
>>
>> We will need a MySQL server as the database for: postfix, dovecot and
>> mail accounts. This will give us mysql-server v8.
>>
>> Signed-off-by: Ammar Faizi <[email protected]>
>> ---
> 
> This patch is lacking in MySQL preparation, like setting up user/pass,
> port to be exposed, database, and whatnot. Instead of deferring many
> things for next, why not include it in this patch?

OK, it's reasonable to have the user setup at this point. I will do that
in the v2.

> Also, it needs persistent storage, container is temporary, but our
> database is permanent???

This is not a Dockerfile problem, it's a container problem. Which is
done at `docker run`. So there is no relevance with mounting host's
directory.

The change is about Dockerfile. And we don't use a docker-compose.yml
here. I don't see the need to involve that. Yes? No? Comment?

-- 
Ammar Faizi

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH server-a001 v1 2/2] Install MySQL server
  2022-04-17 13:26     ` Ammar Faizi
@ 2022-04-17 13:34       ` Alviro Iskandar Setiawan
  2022-04-17 13:44         ` Ammar Faizi
  0 siblings, 1 reply; 13+ messages in thread
From: Alviro Iskandar Setiawan @ 2022-04-17 13:34 UTC (permalink / raw)
  To: Ammar Faizi
  Cc: GNU/Weeb Mailing List, Hazmi Alfarizqi, Hazmi Alfarizqi,
	Alviro Iskandar Setiawan

On Sun, Apr 17, 2022 at 8:26 PM Ammar Faizi <[email protected]> wrote:
> On 4/17/22 8:06 PM, Alviro Iskandar Setiawan wrote:
[...]
> > Also, it needs persistent storage, container is temporary, but our
> > database is permanent???
>
> This is not a Dockerfile problem, it's a container problem. Which is
> done at `docker run`. So there is no relevance with mounting host's
> directory.
>
> The change is about Dockerfile. And we don't use a docker-compose.yml
> here. I don't see the need to involve that. Yes? No? Comment?

Yes, but how do you tell other maintainers to mount the volume
correctly if you don't provide any mechanism in doing this? You should
tell us how to run it too!

-- Viro

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH server-a001 v1 2/2] Install MySQL server
  2022-04-17 13:34       ` Alviro Iskandar Setiawan
@ 2022-04-17 13:44         ` Ammar Faizi
  2022-04-17 13:52           ` Alviro Iskandar Setiawan
  0 siblings, 1 reply; 13+ messages in thread
From: Ammar Faizi @ 2022-04-17 13:44 UTC (permalink / raw)
  To: Alviro Iskandar Setiawan
  Cc: GNU/Weeb Mailing List, Hazmi Alfarizqi, Hazmi Alfarizqi,
	Alviro Iskandar Setiawan

On 4/17/22 8:34 PM, Alviro Iskandar Setiawan wrote:
> On Sun, Apr 17, 2022 at 8:26 PM Ammar Faizi <[email protected]> wrote:
>> On 4/17/22 8:06 PM, Alviro Iskandar Setiawan wrote:
> [...]
>>> Also, it needs persistent storage, container is temporary, but our
>>> database is permanent???
>>
>> This is not a Dockerfile problem, it's a container problem. Which is
>> done at `docker run`. So there is no relevance with mounting host's
>> directory.
>>
>> The change is about Dockerfile. And we don't use a docker-compose.yml
>> here. I don't see the need to involve that. Yes? No? Comment?
> 
> Yes, but how do you tell other maintainers to mount the volume
> correctly if you don't provide any mechanism in doing this? You should
> tell us how to run it too!

OK, I understand your concern.

The database file that needs to be persistent lives in /var/lib/mysql.

So:

   docker run -v $HOST_DIR_FOR_MYSQL_DATA:/var/lib/mysql ...

something like that...

I will provide something for it in the v2. Anyway, since the mysql user
is managed by a database as well, this will be persistent across docker
run too. Hence, it's the host responsibility to retain the mysql users.

-- 
Ammar Faizi

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH server-a001 v1 2/2] Install MySQL server
  2022-04-17 13:44         ` Ammar Faizi
@ 2022-04-17 13:52           ` Alviro Iskandar Setiawan
  2022-04-17 14:02             ` Ammar Faizi
  0 siblings, 1 reply; 13+ messages in thread
From: Alviro Iskandar Setiawan @ 2022-04-17 13:52 UTC (permalink / raw)
  To: Ammar Faizi
  Cc: GNU/Weeb Mailing List, Hazmi Alfarizqi, Hazmi Alfarizqi,
	Alviro Iskandar Setiawan

On Sun, Apr 17, 2022 at 8:45 PM Ammar Faizi <[email protected]> wrote:
> On 4/17/22 8:34 PM, Alviro Iskandar Setiawan wrote:
> > On Sun, Apr 17, 2022 at 8:26 PM Ammar Faizi <[email protected]> wrote:
> >> On 4/17/22 8:06 PM, Alviro Iskandar Setiawan wrote:
> > [...]
> >>> Also, it needs persistent storage, container is temporary, but our
> >>> database is permanent???
> >>
> >> This is not a Dockerfile problem, it's a container problem. Which is
> >> done at `docker run`. So there is no relevance with mounting host's
> >> directory.
> >>
> >> The change is about Dockerfile. And we don't use a docker-compose.yml
> >> here. I don't see the need to involve that. Yes? No? Comment?
> >
> > Yes, but how do you tell other maintainers to mount the volume
> > correctly if you don't provide any mechanism in doing this? You should
> > tell us how to run it too!
>
> OK, I understand your concern.
>
> The database file that needs to be persistent lives in /var/lib/mysql.
>
> So:
>
>    docker run -v $HOST_DIR_FOR_MYSQL_DATA:/var/lib/mysql ...
>
> something like that...
>
> I will provide something for it in the v2. Anyway, since the mysql user
> is managed by a database as well, this will be persistent across docker
> run too. Hence, it's the host responsibility to retain the mysql users.

I don't think we should retain mysql users! This may break with
different database versions, the "mysql" table is an internal thing
that shouldn't be exported. User setup should always be re-done at
initialization. Maybe you can put it in docker-entrypoint.sh????

-- Viro

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH server-a001 v1 2/2] Install MySQL server
  2022-04-17 13:52           ` Alviro Iskandar Setiawan
@ 2022-04-17 14:02             ` Ammar Faizi
  2022-04-17 14:17               ` Alviro Iskandar Setiawan
  0 siblings, 1 reply; 13+ messages in thread
From: Ammar Faizi @ 2022-04-17 14:02 UTC (permalink / raw)
  To: Alviro Iskandar Setiawan
  Cc: GNU/Weeb Mailing List, Hazmi Alfarizqi, Hazmi Alfarizqi,
	Alviro Iskandar Setiawan

On 4/17/22 8:52 PM, Alviro Iskandar Setiawan wrote:
> On Sun, Apr 17, 2022 at 8:45 PM Ammar Faizi <[email protected]> wrote:
>> On 4/17/22 8:34 PM, Alviro Iskandar Setiawan wrote:
>>> On Sun, Apr 17, 2022 at 8:26 PM Ammar Faizi <[email protected]> wrote:
>>>> On 4/17/22 8:06 PM, Alviro Iskandar Setiawan wrote:
>>> [...]
>>>>> Also, it needs persistent storage, container is temporary, but our
>>>>> database is permanent???
>>>>
>>>> This is not a Dockerfile problem, it's a container problem. Which is
>>>> done at `docker run`. So there is no relevance with mounting host's
>>>> directory.
>>>>
>>>> The change is about Dockerfile. And we don't use a docker-compose.yml
>>>> here. I don't see the need to involve that. Yes? No? Comment?
>>>
>>> Yes, but how do you tell other maintainers to mount the volume
>>> correctly if you don't provide any mechanism in doing this? You should
>>> tell us how to run it too!
>>
>> OK, I understand your concern.
>>
>> The database file that needs to be persistent lives in /var/lib/mysql.
>>
>> So:
>>
>>     docker run -v $HOST_DIR_FOR_MYSQL_DATA:/var/lib/mysql ...
>>
>> something like that...
>>
>> I will provide something for it in the v2. Anyway, since the mysql user
>> is managed by a database as well, this will be persistent across docker
>> run too. Hence, it's the host responsibility to retain the mysql users.
> 
> I don't think we should retain mysql users! This may break with
> different database versions, the "mysql" table is an internal thing
> that shouldn't be exported. User setup should always be re-done at
> initialization. Maybe you can put it in docker-entrypoint.sh????

Huh, how come?

By making the data persistent, I don't say we will export the "mysql"
table. If we ever upgrade, we will export and import. But this persistent
storage is meant to retain the data across docker run. Not across MySQL
versions.

Our automatic backup is always doing mysqldump and we don't export the
"mysql" table here.

-- 
Ammar Faizi

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH server-a001 v1 2/2] Install MySQL server
  2022-04-17 14:02             ` Ammar Faizi
@ 2022-04-17 14:17               ` Alviro Iskandar Setiawan
  0 siblings, 0 replies; 13+ messages in thread
From: Alviro Iskandar Setiawan @ 2022-04-17 14:17 UTC (permalink / raw)
  To: Ammar Faizi
  Cc: GNU/Weeb Mailing List, Hazmi Alfarizqi, Hazmi Alfarizqi,
	Alviro Iskandar Setiawan

On Sun, Apr 17, 2022 at 9:03 PM Ammar Faizi <[email protected]> wrote:
> On 4/17/22 8:52 PM, Alviro Iskandar Setiawan wrote:
> > On Sun, Apr 17, 2022 at 8:45 PM Ammar Faizi <[email protected]> wrote:
> >> On 4/17/22 8:34 PM, Alviro Iskandar Setiawan wrote:
> >>> On Sun, Apr 17, 2022 at 8:26 PM Ammar Faizi <[email protected]> wrote:
> >>>> On 4/17/22 8:06 PM, Alviro Iskandar Setiawan wrote:
> >>> [...]
> >>>>> Also, it needs persistent storage, container is temporary, but our
> >>>>> database is permanent???
> >>>>
> >>>> This is not a Dockerfile problem, it's a container problem. Which is
> >>>> done at `docker run`. So there is no relevance with mounting host's
> >>>> directory.
> >>>>
> >>>> The change is about Dockerfile. And we don't use a docker-compose.yml
> >>>> here. I don't see the need to involve that. Yes? No? Comment?
> >>>
> >>> Yes, but how do you tell other maintainers to mount the volume
> >>> correctly if you don't provide any mechanism in doing this? You should
> >>> tell us how to run it too!
> >>
> >> OK, I understand your concern.
> >>
> >> The database file that needs to be persistent lives in /var/lib/mysql.
> >>
> >> So:
> >>
> >>     docker run -v $HOST_DIR_FOR_MYSQL_DATA:/var/lib/mysql ...
> >>
> >> something like that...
> >>
> >> I will provide something for it in the v2. Anyway, since the mysql user
> >> is managed by a database as well, this will be persistent across docker
> >> run too. Hence, it's the host responsibility to retain the mysql users.
> >
> > I don't think we should retain mysql users! This may break with
> > different database versions, the "mysql" table is an internal thing
> > that shouldn't be exported. User setup should always be re-done at
> > initialization. Maybe you can put it in docker-entrypoint.sh????
>
> Huh, how come?
>
> By making the data persistent, I don't say we will export the "mysql"
> table. If we ever upgrade, we will export and import. But this persistent
> storage is meant to retain the data across docker run. Not across MySQL
> versions.
>
> Our automatic backup is always doing mysqldump and we don't export the
> "mysql" table here.

oc, tq

-- Viro

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH server-a001 v1 2/2] Install MySQL server
  2022-04-17 13:06   ` Alviro Iskandar Setiawan
  2022-04-17 13:26     ` Ammar Faizi
@ 2022-04-17 14:57     ` Ammar Faizi
  1 sibling, 0 replies; 13+ messages in thread
From: Ammar Faizi @ 2022-04-17 14:57 UTC (permalink / raw)
  To: Alviro Iskandar Setiawan
  Cc: GNU/Weeb Mailing List, Hazmi Alfarizqi, Hazmi Alfarizqi,
	Alviro Iskandar Setiawan

On 4/17/22 8:06 PM, Alviro Iskandar Setiawan wrote:
> This patch is lacking in MySQL preparation, like setting up user/pass,
> port to be exposed, database, and whatnot.

No for the expose port. We don't expose MySQL port.

Thanks!

-- 
Ammar Faizi

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH server-a001 v1 1/2] Install net-tools
  2022-04-17 12:51 ` [PATCH server-a001 v1 1/2] Install net-tools Ammar Faizi
  2022-04-17 13:13   ` Alviro Iskandar Setiawan
@ 2022-04-18 17:00   ` Hazmi Alfarizqi
  1 sibling, 0 replies; 13+ messages in thread
From: Hazmi Alfarizqi @ 2022-04-18 17:00 UTC (permalink / raw)
  To: Ammar Faizi, GNU/Weeb Mailing List
  Cc: Hazmi Alfarizqi, Alviro Iskandar Setiawan

On 17/04/2022 19:51, Ammar Faizi wrote:

> Install networking tools like netstat and ifconfig. We will often use
> them to inspect and troubleshoot network problem.
>
> Signed-off-by: Ammar Faizi <[email protected]>

LGTM, also just a note that we can't do too much with networking inside 
a non privileged container

Reviewed-by: Hazmi Alfarizqi <[email protected]>

-- hzmi


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-04-18 17:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-17 12:51 [PATCH server-a001 v1 0/2] Install net-tools and MySQL server Ammar Faizi
2022-04-17 12:51 ` [PATCH server-a001 v1 1/2] Install net-tools Ammar Faizi
2022-04-17 13:13   ` Alviro Iskandar Setiawan
2022-04-18 17:00   ` Hazmi Alfarizqi
2022-04-17 12:51 ` [PATCH server-a001 v1 2/2] Install MySQL server Ammar Faizi
2022-04-17 13:06   ` Alviro Iskandar Setiawan
2022-04-17 13:26     ` Ammar Faizi
2022-04-17 13:34       ` Alviro Iskandar Setiawan
2022-04-17 13:44         ` Ammar Faizi
2022-04-17 13:52           ` Alviro Iskandar Setiawan
2022-04-17 14:02             ` Ammar Faizi
2022-04-17 14:17               ` Alviro Iskandar Setiawan
2022-04-17 14:57     ` Ammar Faizi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox