• Что бы вступить в ряды "Принятый кодер" Вам нужно:
    Написать 10 полезных сообщений или тем и Получить 10 симпатий.
    Для того кто не хочет терять время,может пожертвовать средства для поддержки сервеса, и вступить в ряды VIP на месяц, дополнительная информация в лс.

  • Пользаватели которые будут спамить, уходят в бан без предупреждения. Спам сообщения определяется администрацией и модератором.

  • Гость, Что бы Вы хотели увидеть на нашем Форуме? Изложить свои идеи и пожелания по улучшению форума Вы можете поделиться с нами здесь. ----> Перейдите сюда
  • Все пользователи не прошедшие проверку электронной почты будут заблокированы. Все вопросы с разблокировкой обращайтесь по адресу электронной почте : info@guardianelinks.com . Не пришло сообщение о проверке или о сбросе также сообщите нам.

? Built a fun little project to calculate how ancient you are... and sneakily learned Docker in the process!

Lomanu4 Оффлайн

Lomanu4

Команда форума
Администратор
Регистрация
1 Мар 2015
Сообщения
1,481
Баллы
155
This is a basic Go lang project that shows your age if you know your birth year. In this, you have to input your birth year, and it will take the current year automatically. By using the formula Current Year - Birth Year, it shows your current age. This project is mainly intended to learn how to containerize an application. It is not a Go-focused project but mainly Docker-focused instead. A Dockerfile will be created to build a Docker image and run it inside a container.

Once containerized, the application can be run easily using Docker commands on any system that supports Docker, regardless of the host environment. This helps demonstrate the power of containerization and the portability it brings to software development.

The project will also serve as a base to practice Docker fundamentals like:

-> Writing a Dockerfile

-> Building a lightweight image for a Go application

-> Running the image as a container

-> Understanding how to manage input/output inside the container

Overall, this project provides a practical, beginner-friendly example of containerizing a simple application — making it a great starting point for learning Docker and DevOps workflows.

Setup and Usage
? Step 1: Clone the repository:
git clone

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.


cd Know-Your-Age

?Step 2: Create a Dockerfile:
FROM golang:1.20-alpine

WORKDIR /app

COPY . .

RUN go build -o age-calculator Main.go

CMD ["./age-calculator"]

?️ Step 3: Build the Docker Image
docker build -t age-calculator .

(-t age-calculator: Tags the image with a custom name
.: Refers to the current directory as the Docker context)

▶ Step 4: Run the Docker Container
docker run -it age-calculator

When prompted, enter your birth year inside the container and see your age output.

Refer to my Github repository for my project : [

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

]


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

 
Вверх Снизу