avm-eac_ubuntu_base0 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0458409a75617694a688f070514704e9bfa76f4455878410c5be04558f98b55e'
4
- data.tar.gz: d4f93d4d02fdd2bef2d7b5b4969392ba3b7e0f4c22c9fbf0964abcb9842a6db3
3
+ metadata.gz: 97cbcb45f77c4173113cb0115b1cf30424219a0a6f6a7f7c03f5b3c32c9d9ad6
4
+ data.tar.gz: d6a262437cd77cb4b7fcb22f479287a22ba3c434cd97c45b71c1b2ffd48737f7
5
5
  SHA512:
6
- metadata.gz: 0dd402dd2f54671756ce27651734dcf44ccf3c8dc6740fd7478a0aa298edea6995b0e0168f7baaa5324a72f9a7e91db4746735e8ecba2ba3ea4a2254cc7af12b
7
- data.tar.gz: c7c0b33f4bf7dc09bfa27f25b49a31634b715fe7d775d0a1bb34857a2707071052af482fd73acd527a5612dd0dc2d32fa1b16fd7df2bc014427dc6aed78c1043
6
+ metadata.gz: c67a6eb5b5e68f8a62459cfb3b3baca176a83d7575c5b6ea3ee518a790c816818d23b343323a6008a65ed14542ae1a689bebfc812c20c14303396d115fd2a6b6
7
+ data.tar.gz: 4234f9dff1102c60d1dad95de156e8f139b66ebade1a902d61f24c74ccef60f3d5bb15b257523a8c3c451b2b1414bab21878c4850080e4d2d12ef408c8cc3e7a
@@ -7,9 +7,23 @@ require 'eac_ruby_utils/core_ext'
7
7
  module Avm
8
8
  module EacUbuntuBase0
9
9
  class DockerImage < ::Avm::Docker::Image
10
+ USER_NAME = 'myuser'
11
+
10
12
  def stereotype_tag
11
13
  'eac_ubuntu_base0'
12
14
  end
15
+
16
+ def user_home
17
+ ::File.join('/home', user_name)
18
+ end
19
+
20
+ def user_name
21
+ USER_NAME
22
+ end
23
+
24
+ def user_password
25
+ user_name
26
+ end
13
27
  end
14
28
  end
15
29
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacUbuntuBase0
5
- VERSION = '0.1.0'
5
+ VERSION = '0.2.0'
6
6
  end
7
7
  end
@@ -0,0 +1,24 @@
1
+ FROM ubuntu:20.04
2
+
3
+ # Base system update
4
+ RUN apt-get update -y
5
+ RUN apt-get dist-upgrade -y
6
+
7
+ # Timezone
8
+ RUN apt-get install -y tzdata
9
+ RUN ln -fs /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime
10
+ RUN dpkg-reconfigure --frontend noninteractive tzdata
11
+
12
+ # Default user
13
+ RUN /usr/sbin/useradd --shell /bin/bash --home-dir %%user_home%% --create-home %%user_name%%
14
+ RUN /bin/echo '%%user_name%%:%%user_password%%' | /usr/sbin/chpasswd
15
+ RUN /bin/chown %%user_name%%:%%user_name%% %%user_home%% -R
16
+
17
+ # Sudo
18
+ RUN apt-get install -y sudo
19
+ RUN /bin/echo "%%user_name%% ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/%%user_name%%_all_nopasswd && chmod 0440 /etc/sudoers.d/%%user_name%%_all_nopasswd
20
+
21
+ # Container
22
+ USER %%user_name%%
23
+ WORKDIR %%user_home%%
24
+ CMD /bin/bash
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm-eac_ubuntu_base0
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Put here the authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-04 00:00:00.000000000 Z
11
+ date: 2021-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm
@@ -88,7 +88,7 @@ files:
88
88
  - lib/avm/eac_ubuntu_base0/runners/base.rb
89
89
  - lib/avm/eac_ubuntu_base0/runners/base/docker.rb
90
90
  - lib/avm/eac_ubuntu_base0/version.rb
91
- - template/avm/eac_ubuntu_base0/docker_image/Dockerfile
91
+ - template/avm/eac_ubuntu_base0/docker_image/Dockerfile.template
92
92
  homepage:
93
93
  licenses: []
94
94
  metadata: {}
@@ -1,11 +0,0 @@
1
- FROM ubuntu:20.04
2
- RUN apt-get update -y
3
- RUN apt-get install -y sudo tzdata
4
- RUN /usr/sbin/useradd --shell /bin/bash --home-dir /home/myuser --create-home myuser
5
- RUN /bin/echo 'myuser:myuser' | /usr/sbin/chpasswd
6
- RUN /bin/chown myuser:myuser /home/myuser -R
7
- RUN /bin/echo "myuser ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/myuser_all_nopasswd && chmod 0440 /etc/sudoers.d/myuser_all_nopasswd
8
- USER myuser
9
- WORKDIR /home/myuser
10
- ENTRYPOINT /bin/bash
11
- CMD apt-get update -y && apt-get dist-upgrade -y